The documentation for send_batch and send_template_batch both mention:
Parameters
emails – Email instances or dictionaries
However, emails is actually equivalent to *args, i.e. emails internally captures (within send_batch and send_template_batch) all arguments passed to the function. The variable name emails is not actually exposed to the caller, and so isn't properly a "parameter".
Calling:
postmark.emails.send_batch(emails=[email, another_email])
will not work -- the function will instead confusingly return an empty array.
Just in case anybody comes here to troubleshoot this, the correct way to call the functon is rather:
postmark.emails.send_batch(email, another_email)
# ... or alternatively ...
my_emails = [email, another_email]
postmark.emails.send_batch(*my_emails)
Thanks!
The documentation for
send_batchandsend_template_batchboth mention:However,
emailsis actually equivalent to*args, i.e.emailsinternally captures (withinsend_batchandsend_template_batch) all arguments passed to the function. The variable nameemailsis not actually exposed to the caller, and so isn't properly a "parameter".Calling:
will not work -- the function will instead confusingly return an empty array.
Just in case anybody comes here to troubleshoot this, the correct way to call the functon is rather:
Thanks!