When creating a mailto link, I have encountered an issue where the email body is being cut off at around 200 characters, even though my total email length is 1500 characters. This happens despite being below the mailto limit. To address this problem, I have included a computed property in the mailto string due to my use of the "marked.js" package for parsing user input to markdown/html.
I attempted to resolve this issue by setting a new data property called "emailFormat" and performing a marked package operation on the email body during page mount. I expected this to rectify the problem since I am now attaching a string to the mailto body. However, this solution did not work as expected, and the email body still appears incomplete.
The computed property processes the response data from the API using the marked package.
letterContentToHtml() {
if (this.formData.letterContent != null) {
return marked(this.formData.letterContent); // marked is package to parse user input to markdown/html.
}
else {
return null;
}
},
The template section displays the content and a button with a mailto href.
<p class="email-content-data" v-html="letterContentToHtml"></p>
<v-btn class="send-form-btn"
:disabled="!campaignFormValid || this.emailRecepients == ''"
elevation="12"
color="primary"
target="_blank"
:href="mailToString"
@click="updateCampaignList">
Send Email!
</v-btn>
The mailto computed property is defined as follows:
mailToString() {
return "mailto:"+this.formData.emailList+"?subject="+this.formData.subject+"&body="+this.emailContent;
},