extensions icon indicating copy to clipboard operation
extensions copied to clipboard

🐛 [Firestore-send-email] The default replyTo field is not overridden when using GMAIL smtp

Open Dan1ell opened this issue 4 months ago • 1 comments

Configuration

  • Extension name: _ firestore-send-email
  • Extension version: _ firebase/[email protected]
  • Configuration: _ SMTP connection URI: smtps://[email protected]@smtp.gmail.com:465 _ Both the default FROM and default REPLY-TO are set. Mail sending works. Reply to header gets set in received emails.

Problem

Trying to override default Reply To address but it's not working.

Steps to reproduce:

Create a firestore document for use by the extension as follows:

 export const sendEmail = functions.https.onCall((data, context) => {

  const emailAdress = data.to;
  const subject = data.subject;
  const body = data.body;
  const replyTo = data.replyTo;

  try {
    db.collection("mail")
      .add({
        to: emailAdress,
        message: {
          subject: subject,
          html: body,
          replyTo: replyTo
        },
      });
    functions.logger.info("Completed sendEmail for: " + subject);
    return null;
  } catch (error) {
    functions.logger.error("Error within sendEmail: " + error.message);
  }
});
Expected result

The email address sent along with the document appears in the Reply To header of the received email.

Actual result

There are no errors but the default email address from the extension's configuration appears in the email's reply to header instead of the replyTo email address sent along in the document.

Dan1ell avatar Sep 26 '24 18:09 Dan1ell