Send Email Action - HTML Formatting

I’m sending an email to GMAIL amongst other email servers and GMAIL isn’t formatting my HTML tags. I read that potentially its an issue with them. I’m open to other formatting options. We’re running virtual work periods, so I’m emailing the managers at the end of the night to inform them of any unsettled tickets.

UH OH ... Some Tickets Are Not Closed Out <br /> <br /><table><tr><td>Date</td><td>Ticket</td><td>Server</td><td>Ticket Total</td><td>Unpaid Amount</td></tr>{REPORT TICKET DETAILS:T.Date,T.TicketNumber,EN.Server,T.TotalAmount,T.RemainingAmount:T.RemainingAmount>0:<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td><td>{4}</td></tr>}</table>

Thanks,
Joe

Would it not need to be wrapped in html tag?
Been a while since coded sending an email.
Although even when I did generally ended up using hosted email rather than Gmail with insecure optio s and oauth type issues was easier just to straight forward smtp it via website server.

Shoot it might be that simple. I’ll check later.

VPN’d into the server and added HTML/BODY tags. Same result.

The odd part is we’re using our mail server through SiteGround to send the email, so it leads me to believe that the action is only sending emails as plain text with no HTML content type.

I don’t know if this post will be of any help, but Q used a script to create line returns.

Possibly, thinking about it I didn’t use samba send email, I posted code to an endpoint on my website as it was for a esign and pdf receipt system.

I’m not sure what the answer is, but HTML is not supported. The only thing I’ve been able to do is get a breakline using <!rn>. This is better than nothing.

HTML support in the email action would be a nice enhancement.

image

SambaPOS uses SmtpClient. Devs would have to add a bool setting for action type SendEmail like IsHtml and then when constructing a new MailMessage() set IsBodyHtml to the setting value.

Seems like a valid enhancement.

I created a new action to send emails where you can specify if the message body is HTML. Action Type name is “Send Email (MailKit)”.

Place all files from the zip file’s bin folder in the SambaPOS install directory.

Any errors sending an email will be logged to the SambaPOS log file but there will be no popup messages like the default action.

Source code is included. I’ll throw it on github eventually.

Give it a try and let me know.

EDIT:

I forgot to mention, .NET Framework 4.8 is required.

2 Likes

I added CC and BCC as well as better names for some settings.

Multiple CC and BCC addresses are to be comma-separated.

Samba.Modules.Email_1.0.zip (2.0 MB)

1 Like

@Memo Thanks for making this. Works Great! I’m using this to send out reservation confirmation emails. They look much better in html formatting than plain text.

For anyone wanting to use this, you will have to place the files on each computer you will be sending emails from. You will also have to go to the properties of each of the 6 files and unlock each one.
FjdOWYZFZ8

Thanks again, @Memo !

1 Like