I have done something similar, but not with sendgrid. The service I have been using is
https://www.paubox.comThere API is dirt simple. They encrypt the emails with HIPAA compliance. Plus they are inexpensive.
This it the CallURL body I send to them.
The Teamdesk codes will likely be similar for Sendgrid..
ps... remember if you're sending with the clients email as the from, make sure you have the client update there spf records.
{
"data": {
"message": {
"recipients": [
<%=[TEMP Email Notes To (only 1 address at a time)]%>
],
"headers": {
"subject": "<%[Email Subject]%>",
"from": "me@sample.com",
"reply-to": "me.samle.com"
},
"allowNonTLS": false,
"forceSecureNotification": false,
"content": {
"text/html": "<%[Email Message (use the ? for formatting)]%>"
},
"attachments": [
{"fileName": <%=FileName([Temp Encrypt File 1])%>, "contentType": <%=FileType([Temp Encrypt File 1])%>, "content": <%=[Temp Encrypt File 1]%> }
<%? not IsNull([Temp Encrypt File 2]) %>, {"fileName": <%=FileName([Temp Encrypt File 2])%>, "contentType": <%=FileType([Temp Encrypt File 2])%>, "content": <%=[Temp Encrypt File 2]%> }<%?%>
<%? not IsNull([Temp Encrypt File 3]) %>, {"fileName": <%=FileName([Temp Encrypt File 3])%>, "contentType": <%=FileType([Temp Encrypt File 3])%>, "content": <%=[Temp Encrypt File 3]%> }<%?%>
<%? not IsNull([Temp Encrypt File 4]) %>, {"fileName": <%=FileName([Temp Encrypt File 4])%>, "contentType": <%=FileType([Temp Encrypt File 4])%>, "content": <%=[Temp Encrypt File 4]%> }<%?%>
<%? not IsNull([Temp Encrypt File 5]) %>, {"fileName": <%=FileName([Temp Encrypt File 5])%>, "contentType": <%=FileType([Temp Encrypt File 5])%>, "content": <%=[Temp Encrypt File 5]%> }<%?%>
<%? not IsNull([Temp Encrypt File 6]) %>, {"fileName": <%=FileName([Temp Encrypt File 6])%>, "contentType": <%=FileType([Temp Encrypt File 6])%>, "content": <%=[Temp Encrypt File 6]%> }<%?%>
]
}
}
}