2

I use firebase email trigger and trying to send an email to my gmail account and another account which is not gmail. I received email only on my another account, gmail doesn't work.

Here is my code.

db.collection('mail').add({
      to: 'user@gmail.com',
      cc: 'user@example.com',
      message: {
        subject: 'Welcome',
        html: 'Hello',
      },
    })

Here is my mail collection response

enter image description here

Response looks fine.

I received email only on user@example.com account.

I'd be very grateful if some could help me.

Thanks in advance.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
kdos
  • 31
  • 2
  • 5

3 Answers3

1

The Trigger Email extension for Firebase makes no distinction in how it handles gmail destinations vs other email addresses, so it is very unlikely that this difference happens in the sending of the email.

More likely the email is getting caught in either the spam filter of gmail, or in another spam filter along the way to gmail. I recommend checking your gmail spam box first.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • I checked spam, junk... Every single folder, I tried with more gmail accounts and still not received an email. – kdos Jan 20 '22 at 18:58
0

I have changed from email and it works now.

Thanks

kdos
  • 31
  • 2
  • 5
0

Be sure to check in the firebase/firestore itself,

the errors will show in the document itself: [![error code in firestore][1]][1]

as mentioned, do check your trigger-email settings, that they are linked to the correct collection: [![collection linked to trigger-email][2]][2]

// Firestore data converter
export const contactFormConvertor = {
  toFirestore: (contactform: ContactformDTO) => {
    return {
      to: <INSERT email you wish to receive the mail on>,
      name: contactform._name,
      from: <INSERT email you use to send the mail from>,
      replyTo: contactform._email,
      message: {text: contactform._message + '\n\nkind regards, ' + contactform._name,
        subject: contactform._subject}
    };
  },
  fromFirestore: (snapshot: { data: (arg0: any) => any; }, options: any) => {
    const data = snapshot.data(options);
    return new ContactformDTO(data.name, data.email, data.subject, data.message);
  }
};```


  [1]: https://i.stack.imgur.com/08cIQ.png
  [2]: https://i.stack.imgur.com/m4Sod.png
Ryan Reddy
  • 47
  • 6