Email creation with To CC and BCC automaticaly fed

Hi,

I am using the email component to prepare mail template for users.
The To, CC and BCC are automaticaly defined based on a data selected by the user.
Last year, until march, the email was well created with To, CC and BCC well fed.
Today (note: my application is only used 3 month a year during winter), the email is created but To CC and BCC are not fed … or to be more exact

  1. If the field in the Google Sheet contains directely (hard coded) an email then it is ok.
  2. If the field in the Google Sheet contains a formula that build the email then it is not ok

I have forced the column type to email (that was not necessary last year). But it does not change the behaviour.

Does anybody can help ?

I’m currently working through something similar. Realized one of my functions using the compose email action wasn’t working anymore. My function is supposed to handle multiple recipients in the TO. I was using a semicolon delimiter between emails, built using glide template and joined list columns, but I think I might have better luck with commas instead. Didn’t get a chance to finish testing today, so I’m not sure if that’s the answer. I plan to wrap in up tomorrow or the next day and have it fixed.

I’m mentioning this in case your issue is due to having multiple emails in either the TO, CC, or BCC. I’m still not clear on what I have to fix yet, but I’m pretty sure it’s due to my delimiter choice.

2 Likes

Hum, in fact I am already using commas, and it does not work.
It might be something else…

1 Like

If I learn more, I’ll let you know. When I originally built that part of my app, it was thrown in very quickly, and I thought it worked at that time. Never really tested it thoroughly enough. I’ve been doing some cleanup in my app and decided to rebuild that part that creates the list of selected user emails.

Are you using Google sheet formulas instead of glide computed columns? It really shouldn’t matter, unless you are experiencing a side effect of the lag from waiting for data to sync between glide and google sheets. Does your column of emails look correct to you when viewing it in the Glide data editor (just to verify that data is synced)? Do you have any spaces or carriage returns between your emails? Just in case it’s encountering an invalid character…

One further question, what email platform it is? Is it Gmail, Outlook or any other platforms?

I have seen the problem with Gmail and have not tested with others… anyway, the “mailto:” url generated does not contains the to cc and bcc.

Hi !
I have finaly found the issue.
Last year the multi mail fields were filled with : <aaa@bbb.ccc>,<ddd@eee.fff>
This format does not work anymore but the following does : aaa@bbb.ccc,ddd@eee.fff

2 Likes

Have you tried just using a sheet range in the apps script that sends the emails so you can avoid using a comma or semicolon? I used this apps script to send emails for a couple of years now

function emailNotifications(sheet) {
  Logger.log("Sending emails...");
  var send = sheet.getRange('L2').getValue();
  var subject = sheet.getRange('G3').getValue();
  var text = sheet.getRange('C7').getValue();
    var lastRowEN = sheet.getLastRow();
    var emails = sheet.getRange('H13:H'+lastRowEN).getValues();
    for (j=0; j<emails.length;j++) {
      var email = emails[j][0];
      if (email!="") {
        GmailApp.sendEmail(email, subject, text);
        Logger.log("Email sent");
        sheet.getRange('G3').clear();
        sheet.getRange('C7').clear();
        sheet.getRange('L2').clear();
      }

I trigger this event by having Glide ener a value into a cell, the value edited is triggered and the script clears the value. Like a button…

The cc and bcc are still used int the same manner

MailApp.sendEmail(emailAddress, subject, message, {
  htmlBody: message,
  cc: 'internal1@email.com',
  bcc: 'internal2@email.com'
});

Just use a range

2 Likes