Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

How to Terminate Email production from within the BeforeEmail Event.

Hi, I need to abort the creation of an email. Started either from code or by the email button in the preview panel, if a variable in the database has a particular value, Eg Purchase Order not authorised, how can I code this in version 22.02 Build 373

Thanks

Comments

  • Hi Colin,

    Currently there is not a property or method that can be used to prevent email from being sent. We'll add this to the requested feature list.

    It can be done indirectly, by using BeforeEmail to unregister the email plug-ins and AfterEmail to re-register the plug-ins. When no email plug-ins are available, no email is sent. It is a bit of a hack.

    I emailed you an example I created. For the example I created a TmyEmailManager class with public methods for EnableEmail and DisableEmail.

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
Sign In or Register to comment.