Kuba Wyrobek
Kuba Wyrobek

Reputation: 5273

Forwarding emails sent by accounts-password package

Accounts-password package has built-in 3 methods to send emails:

Accounts.sendResetPasswordEmail(userId, [email])
Accounts.sendEnrollmentEmail(userId, [email])
Accounts.sendVerificationEmail(userId, [email])

When I execute Accounts.sendResetPasswordEmail then I don't see option to put BCC or forward this email.

Under the hood the accounts-package use Email.send method (https://github.com/meteor/meteor/blob/devel/packages/accounts-password/password_server.js)

How can I wrap Email.send to always add BCC field ?

Upvotes: 0

Views: 109

Answers (1)

Hubert OG
Hubert OG

Reputation: 19544

You can manually override the Email.send method:

var send = Email.send;
Email.send = function(options) {
  _.extend(options, {
    bcc: 'your@email',
  });
  send(options);
});

Upvotes: 1

Related Questions