Thank you very much for your answers. I would try it but since already have started with some custom php I would have to take some drugs in order to restart the email process.
What you suggest could work but in my case, I think it will get too complicated since the email itself has some conditions. For example, if the product was on sale then I have to display both prices, add some styling to the original price, and display the one with the sale. With normal php this is easier to control. Guess with your suggestion it would be more difficult to create.
Again thank you very much. If I wouldn’t have found a solution I would certainly try it.
I’m sure it’s a good idea to keep to your existing solution. However if at some point you want to use a more ‘Wappler’ approach, then I expect you may be able to incorporate the conditions you need in the MySQL part.
Eg I wanted to exclude rows where a particular field didn’t have a value (to avoid having a field label with no data), so one line of my trigger is:
IF (NEW.ISBN is null || NEW.ISBN = '','', CONCAT ( '<tr><td width="70"><span>ISBN:</span></td><td width="330">', NEW.ISBN, '</td></tr>')),
Creating HTML emails is a miserable task however you do it.
Hopefully by the time you need this feature again, Wappler’s mailer extension will be more capable. It is one of the bigger omissions in Wappler at the moment.
So true. And the worst is that clients think is just a matter of minutes to create something like that. I am, so often, thinking what other developers (that are not using Wappler or something similar (if it exists)) really do. I mean you create something that is complicated, make it work with minimal clicks and they still don't understand how much work there is behind it. If I had to create by handcoding what I create with Wappler I would be so desperate.
Hi I have used another approach to this exact situation.
Create a dynamic page on the web server (PHP, ASP.NET OR ASP) connected to your database and formatted to display the results you need based on QueryString Values sent to the page. Then use “MHTML BODY” in the email script with the body content retrieving the page described plus dynamic QueryString Values to run the page. The recipient gets a beautiful HTML email formatted exactly as you need. Just be sure to include any email page CSS in the head of the included file rather than from the website to make sure it gets styled correctly. Typical code as final line in the email sending script in this case using CDO…
Yes my example is ASP but would work in any language with modified code. the principle is that the dynamic email page content can be formatted as wished, repeat regions etc. It just needs the query string values sent from the email script to retrieve the page as the email body. In PHP typically the MHTML would be replaced with something like … $body = "http://site.co.uk/orders.php?OrderID =
Personally i prefer to build the HTML body in the server action rather than at app connect side
I simply define a variable within the server action and use “set Value” to add HTML to the variable then simply send it at the end with send mail, no need for client interaction, no custom ASP code, 100% Wappler
Really clever what you did!
This actually demonstrates that Wappler is actually a programming software. It will just take a little more of time for the mass to understand that Wappler is the only software that actually programs by mostly clicking in order to save time and effort and to be able to focus on more strategic decisions.
Congrats @Hyperbytes, personally I find this as one of the most interesting posts that shows how incredible Wappler actually is
Did anything get introduced into Wappler over the past 12 months to make it easier to send repeat region data html template in an email? e.g the contents of an abandoned shopping cart