firebase / extensions

Source code for official Firebase extensions
https://firebase.google.com/products/extensions
Apache License 2.0
893 stars 383 forks source link

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

Open Dan1ell opened 1 month ago

Dan1ell commented 1 month ago

Configuration

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.

akoval29 commented 1 month ago

same problem. my replyTo field contains email address (string), but same result.

if i try to change "Default REPLY-TO address (Optional)" in extension configuration from default value to different, i have: "There was an unknown error while processing the request."