Search code examples
firebasesmtpurifirebase-extensions

Use more than one email account for firebase trigger email extension


I am using firebase extension trigger email for sending mails on firestore events trigger and have added smtp uri of a single email account of my domain in the form of smtps://name@domain.com:password@smtp.yandex.com:465**) , how can i send email through different email accounts like through name2@domain.com as it is unable to send the mail through an other email account but the smtp uri one


Solution

  • If you want to send email from different accounts with the Trigger Email extension, you'll need to:

    1. Install a separate instance of the extension for each account.
    2. Use a separate collection for triggering the email sent from each account.

    So in your example, you'd install the extension twice, once for emails from name@domain.com triggered from writes to the collection emails_from_name and once for name2@domain.com triggered from writes the collection emails_from_name2.