Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
key.replace('_', ' ').title(),
value
))
content = '\n-------------------- \n'.join(content)
# Build email message parameters
message_args = {
'body': content,
'to': addresses,
}
if self.subject:
message_args['subject'] = self.subject
else:
message_args['subject'] = self.title
genemail = GeneralSettings.for_site(request.site).from_email_address
if genemail:
message_args['from_email'] = genemail
if self.reply_address:
# Render reply-to field using form submission as context.
context = Context(self.data_to_dict(processed_data, request))
template_reply_to = Template(self.reply_address)
message_args['reply_to'] = template_reply_to.render(context).split(',')
# Send email
message = EmailMessage(**message_args)
message.send()