9
Views
1
Comments
Email Image Attachment From Reactive App
Application Type
Reactive

Hi all, 

I was facing an issue when try to attach an image to an email via a reactive web app. 

I'm currently using a reactive web app with a form that captures an image via upload. The form data along with the image binary is sent to a server action in a traditional web app (that handles email). 

Since Emails cannot have a 'binary' as an input variable, I convert the binary to text in the server action in the email component. I then convert back to binary and attach as an attachment in the emails 'preparation' action.

The image, however, is not rendering correctly and I just get a blank '.bin' file in the attachment. I tried toggling the 'mime-type' as well but to no avail. 

Is there a step I may be missing if I'm trying to use a form from a reactive app and have the image captured sent to a traditional web app for email purposes?

Is there a better way to do this process?

Any help/suggestions would be much appreciated 

Rank: #54

Hi Farhan,


I would definitely save the image in a database entity, get the id of the record saved and used it as an input to the email.

On the preparation of the email, I would fetch the image using the Id passed as a parameter.


Additionally, I would set a timer to remove these images from the database since they occupy space in the database.


Kind Regards,
João