Send emails with attachments with Gmail via Make
Hello,
I send emails from Ninox with my Gmail mailbox using Make.com (Integromat) but it is impossible for me to send attachments.
This is what my code looks like:
---
Récupération des documents à joindre
---;
let attLegal := [if CGV = true then
Compte.Entreprise.'Conditions Générales de Vente'
end, if 'Données personnelles' = true then
Compte.Entreprise.'Traitement des données personnelles'
end, if 'Données de santé' = true then
Compte.Entreprise.'Traitement des données de santé'
end, if 'Confidentialité' = true then
Compte.Entreprise.'Politique de confidentialité'
end, if RIB = true then
Compte.Entreprise.RIB
end];
let attDocs := 'Documents 1:N'.Document;
---
Création d'un tableau virtuel comprenant tous les documents à joindre
---;
let attAllDocs := array(attLegal, attDocs);
---
Données pour Gmail
---;
let donnees_api := {
RecordID: ID,
'Expéditeur': Expediteur,
'Destinataire principal': 'Destinataire principal',
'Destinataire en copie': 'Destinataire en copie',
'Destinataire en copie cachée': 'Destinataire en copie cachée',
Objet: Sujet,
Contenu: Commentaires,
'Pièces jointes': attAllDocs
};
---
API Make
---;
let dataRecord := donnees_api;
let webhookURL := "https://hook.eu2.make.com/my_api_code";
let data := dataRecord;
http("POST", webhookURL, {
'Content-Type': "application/json"
}, data)
The email is successfully sent from my Gmail mailbox with the content (the text I created on Ninox) but the attachments are not sent.
Make.com does not recover files.
If someone is sufficiently familiar with Make.com, I would appreciate help so that my emails go through my Gmail box and not through Ninox Sendinblue (which arrives in my clients' spam folders).
Thanks for your help.
2 replies
-
Sorry it's not Sendinblue but SendGrid
-
Try using the shareFile() function on your attachment, add a text field to store this in
textField := shareFile(attAllDocs)
then in the data use the text field
let donnees_api := { RecordID: ID, 'Expéditeur': Expediteur, 'Destinataire principal': 'Destinataire principal', 'Destinataire en copie': 'Destinataire en copie', 'Destinataire en copie cachée': 'Destinataire en copie cachée', Objet: Sujet, Contenu: Commentaires, 'Pièces jointes': textField };
Then in Make you can add a get document from URL, or most modules accept a document's URL
Or, you can use the Ninox module "Download file from record", to get the filename and data which you can directly enter into your gmail module
Content aside
- 8 mths agoLast active
- 2Replies
- 61Views
-
2
Following