Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Dan1ell opened this issue Sep 26, 2024 · 2 comments
Labels
extension: firestore-send-email Related to firestore-send-email extension type: bug Something isn't working

Comments

@Dan1ell
Copy link

Dan1ell commented Sep 26, 2024

Configuration

  • Extension name: _ firestore-send-email
  • Extension version: _ firebase/[email protected]
  • Configuration:
    _ SMTP connection URI: smtps://xxx@[email protected]: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 Dan1ell added the type: bug Something isn't working label Sep 26, 2024
@akoval29
Copy link

akoval29 commented Oct 14, 2024

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."

@twachowski
Copy link

Have you tried moving the replyTo field one level higher?
Like this:

db.collection("mail")
  .add({
    to: emailAdress,
    replyTo: replyTo
    message: {
      subject: subject,
      html: body
    },
  });

The documentation says it should be present within sender and recipient fields, not message fields.

@Gustolandia Gustolandia self-assigned this Jan 10, 2025
@Gustolandia Gustolandia added the extension: firestore-send-email Related to firestore-send-email extension label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension: firestore-send-email Related to firestore-send-email extension type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants