185
Views
12
Comments
How to send PDF attachments  in email using Reactive Web
Application Type
Reactive

How to send PDF attachments in email using Reactive Web, I have already used Ultimate PDF I can download it in PDF form, But I am not able to send it in email.

Thanks and regards

Ashutosh Soni

2023-08-28 07-00-10
Paulo Torres
Champion

Hello,

In ultimate PDF you have a server action (ScreenToPdf) to download the PDF in server side.

To send the attach you Should create a tradicional app. As far as I know it's not possible in react.

Regards

2018-08-27 08-29-35
Fábio Vaz

Hello,

At this point you must create a Tradicional Web Application and expose the email in a public action.

Consume the action on your React application. Pay attention to security issues like parameters, etc...  

2022-08-03 04-32-50
Ravi Punjwani

@Ashutosh think of splitting your problem into two parts.

  • First from your UI to generating a PDF
  • Sending this PDF in an Email attachment.


Ultimate PDF is really a great component that help you all the way till you generate your PDF file. Everything upto here can be done in your Reactive app.

After that the remaining part has to be done in Traditional Web app which actually sends an email. You expose a public server action which receives the PDF and sends as an email attachment.

Your reactive app will call the public server action for sending the email. Here's how you connect both bits together.

2020-09-21 08-42-47
Vincent Koning

I myself find that exposing a public action to send an email via a traditional app an architecture constraint. You are letting a core component (the backend) communicate with a front-end facing application (emails are just like screens and there for front-end in my opinion). This is an upward reference that should not be allowed.

My solution for this is using BPT Light. I have an SendEmail entity with all data needed to sent an email, including the PDF. This SendEmail entity has its event exposed (advanced setting). The Email application has a process that will trigger on the creation of records in this SendEmail entity. It will then execute all needed actions to send (and only send) the email. When this email has been sent the SendEmail record can be removed.

2023-08-28 07-00-10
Paulo Torres
Champion

I use sometimes but for main cases is to use a rocket to solve small problem.

You can define tradicional module as foundation.

2020-09-21 08-42-47
Vincent Koning


The fact that you can change the classification doesn't mean that it is architecturally correct. And for now, I think it is not. 

And it is not a rocket. It's a very elegant method to trigger actions that take an unpredictable amount of time, like sending an email is. Best to do this async so no-one is affected by this. 

2023-08-28 07-00-10
Paulo Torres
Champion

When a new Record or update on certain table means send e-mail, I fully agree with you.

It's what I'm doing um some projects.

Simple e-mails I use react.

2020-09-21 08-42-47
Vincent Koning

It's a dedicated entity for just triggering an email. That is what I always use and it works very good. Entity contains all relevant information like From, To, CC, Subject, Body, Attachment(s) and more. Add an EmailType static to make sure the correct email is sent and that's all you need. 

2023-08-28 07-00-10
Paulo Torres
Champion

Sounds good, it's a good idea 😁 You have my like 💪🏼

2022-07-20 14-09-17
Ashutosh Soni

Hi Paulo,

Do you have any OML file for BPT logic ?


Regards

Ashutosh

2020-09-21 08-42-47
Vincent Koning

I'll try to make you one Ashutosh. I am very busy at the moment so if you have not received it by wednesday then please ping me.

2023-08-28 07-00-10
Paulo Torres
Champion

I can prepare a simple demo for you on weekend.

Regards

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.