You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Mailer class indicates that to send html messages, the message body should be a 2-list or a 2-tuple. I tried setting auth.param.messages['reset_password']['body'] to a list, without success. After spending some time debugging, I think I found the root cause: Even if a list or tuple is provided as the message body, the params.message['body'] ends up being of class pluralize. It is params.message['body'].text that will contain the original list or tuple.
Also, a related issue. Both the plain text and HTML components of the body should be able to interpret shortcuts like {first_name} and {link} in the string.
Here is a quick change to the send method of the Auth class that fixes both the issues above. But it may not be the best solution, because it eliminates the original pluralize class.
if isinstance(message["body"].text, (list, tuple)):
body = [element.format(**d) for element in message["body"].text]
else:
body = message["body"].format(**d)
The text was updated successfully, but these errors were encountered:
The
Mailer
class indicates that to send html messages, the message body should be a 2-list or a 2-tuple. I tried settingauth.param.messages['reset_password']['body']
to a list, without success. After spending some time debugging, I think I found the root cause: Even if a list or tuple is provided as the message body, theparams.message['body']
ends up being of classpluralize
. It isparams.message['body'].text
that will contain the original list or tuple.Also, a related issue. Both the plain text and HTML components of the body should be able to interpret shortcuts like
{first_name}
and{link}
in the string.Here is a quick change to the
send
method of theAuth
class that fixes both the issues above. But it may not be the best solution, because it eliminates the originalpluralize
class.The text was updated successfully, but these errors were encountered: