pyramid_mailer does not send to cc addresses #333

Closed
dckc opened this Issue Nov 1, 2011 · 2 comments

Comments

Projects
None yet
1 participant

dckc commented Nov 1, 2011

In trying to debug my usage of pyramid_mailer, I discovered that the cc addresses
weren't included in the recipients used to send a message.

The following test case captures what I was expecting and what I got instead:

dm = pyramid_mailer.mailer.DummyMailer()
m = Message(recipients=['r1@example', 'r2@example'],
... cc=['c1@example'])
dm.send_immediately(m)
dm.outbox[0].recipients
['r1@example', 'r2@example', 'c1@example']

Failed example:
dm.outbox[0].recipients
Expected:
['r1@example', 'r2@example', 'c1@example']
Got:
['r1@example', 'r2@example']

I initially encountered the problem with 0.5, i.e.

pyramid_mailer-0.5.tar.gz#md5=115ed5a721e9f881e59529b901568aa4

but I re-tried with 0.4.1 and saw the same symptoms.

dckc commented Nov 1, 2011

It seems that msg.send_to should be used instead of msg.recipients
in this utilitiy method in pyramid_mailer.mailer.Mailer:

def _message_args(self, message):

    message.sender = message.sender or self.default_sender

    return (message.sender, 
            message.recipients,
            message.to_message())

@dckc dckc closed this Nov 1, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment