I use emailjs to send emails from my Wix website. Essentially I set up a template on emailjs and send it parameters from my Wix code, e.g.:
let params = {
user_id: ‘’,
service_id: ‘’,
template_id: ‘’,
template_params: {
‘’: ‘’,
‘’: ‘’
}
};
But I am struggling to work out how to send it an image that someone has uploaded onto my site. Has anyone done this that could show me how the parameters should look? I really want the image to appear inline within the body of the email.
Many thanks in advance.
First of, as it is through Emailjs, then I suggest that you try contacting their own support first and asking them how to do it.
https://www.emailjs.com
Is it possible to send embedded attachment?
This is true! To do this, you need to open the code editor (<> icon) and add the IMG tag with a cid. When cid is the parameter name of your attachment. For static attachment it’s name of file with file extension.
For example, my parameter name for attachment is “nice_cat”, so I need to add IMG tag: ![My Cat]()
Note: This works only for images.
Especially when they list their own code for Wix there too.
https://www.emailjs.com/docs/examples/wix-code/
https://www.emailjs.com/docs/user-guide/file-attachments/
https://www.emailjs.com/docs/user-guide/file-attachments/file-upload-example/
https://stackoverflow.com/questions/39330239/using-emailjs-to-send-inline-attachment-via-javascript
https://girizano.wixsite.com/codecorner/post/send-email-thru-gmail-and-others-in-wix-code