Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sibren 40 posts 212 karma points c-trib
    Jul 28, 2021 @ 06:33
    Sibren
    0

    PDF invoice generation

    Hi,

    Is there a (simple) way to attach the invoice as a PDF to the email?

    Regards, Sibren

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Jul 28, 2021 @ 08:02
    Matt Brailsford
    1

    Hi Sibren,

    I guess it depends on your definition of simple 😁

    You can hook into the email sending pipeline as outlined here https://vendr.net/docs/core/1.8.0/key-concepts/pipelines/ and create your own AttachPdfInvoiceTask task to read the current HTML for the email (which will be passed in a context argument) about to be sent, then use a PDF generation library to generate the PDF and add it to the emails attachement.

    You'd then want to register the task just before the email get's sent

    composition.WithSendEmailPipeline()
        .InsertBefore<SendSmtpEmailTask, AttachPdfInvoiceTask>();
    

    Hope this helps

    Matt

  • Sibren 40 posts 212 karma points c-trib
    Jul 28, 2021 @ 08:47
    Sibren
    0

    Hi Matt,

    Thanks. I was hoping for even more simpler, but this'll do!

    Regards.

  • Bo Jacobsen 604 posts 2402 karma points
    Sep 24, 2021 @ 12:48
    Bo Jacobsen
    0

    Hi.

    We have just done the exact same thing and it is working locally.

    Our issue is that we use the rotativa.mini and that program is using an .exe file and we wont be allowed to use a .exe file on our webservers.

    So my question is if you got it working using any free pdf converters or if you know of any?

  • anh-duc-le 38 posts 152 karma points
    Aug 19, 2022 @ 13:13
    anh-duc-le
    0

    Is it on the roadmap to include support for PDF generation at some point in the future? We would like to implement a custom implementation for now, but would like to know if there will be native support in the future.

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Aug 19, 2022 @ 14:35
    Matt Brailsford
    0

    @anh-duc-le it's not currently on our roadmap no, so you'll want to follow a similar custom approach

Please Sign in or register to post replies

Write your reply to:

Draft