3

I'd like to have a PloneFormGen form which both

  • Writes the entry to database for CSV export

  • Sends out email

Is it so that if email send fails the transaction is rolled back and also no entry is written? How one can configure PloneFormGen or email output so that the database entry is written and transaction completes even if SMTP fails?

1 Answer 1

3

Send with immediate=True and catch exceptions:

    try:
        self.context.MailHost.send(root.as_string(), immediate=True)
    except Exception as e:
        log = logging.getLogger("MailDataManager")
        log.exception(e)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.