I've been struggling this for a week but still don't see any light. My company is using a google form to collect users' orders, and then send them emails regarding their order using GmailApp.sendEmail. The email includes a link to the product page on our website and a Paypal link for the users to make payment.
My company is using Google workplace emails, and all our emails are dkim authenticated and spf record is added(whatever it is..). I tried sending a same email to mailt-tester.com and it gets 10/10
However, when I sent these emails to Hotmail, they got into junk folder. I've tried changing my message and found out only when I removed the links would the emails get into inbox without problem. (Previously I had problem with Gmail too. I had had a paypal button's picture as link in the email, only after I removed that picture and changed the link to text link would the email get into Gmail's inbox)
Isn't paypal link or other links in an email message a common practice for many companies? Why would mine get into junk? Here is the code in app script, although I don't believe there is any problem with it:
function onWskSubmit(e){
ss = SpreadsheetApp.getActive();
let row = e.range.rowStart;
let email = ss.getRangeByName('payer_email').getValues()[row-1][0];
GmailApp.sendEmail(email,'Thanks for your order','ww',{
bcc:'shenkwen@mycompany.org',
name:'company name',
replyTo:'shenkwen@mycompany.org',
htmlBody:message(row)
})
}
function message(row){
....
....
let header = `
<p>Dear${name}:
<p style="text-indent:2em">Thanks for your oder. Your subtotal:</p>
<table>
<tr>
<th style="text-align:left;width:200px">item</th>
<th>fee</th>
</tr>
${items}
<tr>
<td>
Total
</td>
<td>
$${total}
</td>
</tr>
</table>
`;
let paypalMessage = `
<p>Your order Id is ${orderId}。Please<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&no_shipping=1&tax=0&amount=${total}&business=accounting@mycmpany.org¤cy_code=USD¬ify_url=https://mycompany.org/pp.php&item_name=${products.join(',')}&item_number=${orderId}">click here</a>to pay with Paypal.</p>
`;
return header + paypalMessage;
}