postmarker
postmarker copied to clipboard
Suggestion: better documentation of `emails` parameter for send_batch and send_template_batch
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!
Thanks @gregsadetsky that was exactly what I was searching for.