So I added a template for my quote emails, which worked out fine, but when I choose the template when sending the quote (without adding something to the content window), it gives me the following errors:
A PHP Error was encountered
Severity: Warning
Message: unlink(example/uploads/temp/mpdf): Is a directory
Filename: helpers/mpdf_helper.php
Line Number: 131
Backtrace:
File: /example/application/helpers/mpdf_helper.php
Line: 131
Function: unlink
File: /example/application/helpers/pdf_helper.php
Line: 254
Function: pdf_create
File: /example//helpers/mailer_helper.php
Line: 92
Function: generate_quote_pdf
File: /example/application/modules/mailer/controllers/Mailer.php
Line: 208
Function: email_quote
File: /example/public_html/efact/index.php
Line: 327
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: escapeshellcmd() has been disabled for security reasons
Filename: phpmailer/class.phpmailer.php
Line Number: 1442
Backtrace:
File: /example/vendor/phpmailer/phpmailer/class.phpmailer.php
Line: 1442
Function: escapeshellcmd
File: /example/vendor/phpmailer/phpmailer/class.phpmailer.php
Line: 1485
Function: isShellSafe
File: /example/efact/vendor/phpmailer/phpmailer/class.phpmailer.php
Line: 1337
Function: mailSend
File: /example/vendor/phpmailer/phpmailer/class.phpmailer.php
Line: 1213
Function: postSend
File: /example/application/modules/mailer/helpers/phpmailer_helper.php
Line: 139
Function: send
File: /example/application/helpers/mailer_helper.php
Line: 104
Function: phpmail_send
File: /example/application/modules/mailer/controllers/Mailer.php
Line: 208
Function: email_quote
File: /example/public_html/efact/index.php
Line: 327
Function: require_once
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /example/vendor/codeigniter/framework/system/core/Exceptions.php:271)
Filename: helpers/url_helper.php
Line Number: 564
Backtrace:
File: /example/efact/application/modules/mailer/controllers/Mailer.php
Line: 213
Function: redirect
File: /example/public_html/efact/index.php
Line: 327
Function: require_once
I get the same errors when I just add the HTML in the content window, without selecting the template.
Could you post an example of the HTML you are trying to use please? I suspect something simple in your signature is causing the script to terminate early.
Also - you should probably edit your first post to sanitize some of your paths; you are disclosing much more than you should! at the very least, change your domain names to âexample.comâ
Thanks for the security comment, didnât really think of that
Also, the example would be a tad too long, since itâs an entire HTML email template (I designed and coded the whole thing like an HTML newsletter). Iâll send it in PM.
Remember your template is for HTML <body>! Your code is not e-mail friendly! You are also using tags which are not universal (e.g. <title> is valid W3-HTML, but not valid e-mail HTML)! Whilst it will work from within a mail client, it is possible that the tags can conflict with the code inside applications. Mail clients will ignore the code it doesnât need; webapps will digest it.
Also, you have conditional statements hidden within HTML comment tags (valid W3 backwards compatibility for static HTML), however you are placing those tags within a PHP webapp. To immediately rule out both of these, try the following:
Remove the <HTML> and <HEAD> sections of code (and their closing tags); these are applied by default by Invoiceplane. If that doesnât work,
Try using a âbasicâ template, utilising inner HTML only, at the most basic level. You are not creating a complete HTML document - you are creating HTML body. Stick to the really simple, like some <p>, <a> and <strong> blocks. If this works, try:
Add some CSS related content.
If 2 and 3 work, re-examine your body text for punctuation (e.g. use " and not " ), and test other things one at a time, such as <!--[if !mso]><!--> to see what finally breaks things :).
Hey Twoup, Iâve been working with email templates professionally for almost 2 years fulltime, so Iâm pretty sure itâs email friendly. Thanks for the critical review though
However, it could be that my code isnât Invoiceplane email friendly since there are (like you mentioned) conditional comments and all sorts of things in there that it might not parse.
Anyhow, I canât remove the head part of the html, it is quite fundamental for a good email. If this webapp only supports parts, Iâd have to do something else about it then It wouldâve been nice to be completely free to write your own code while using the InvoicePlane variables. Will try further before I write it off though!
Itâs not a critical review, itâs a statement of fact. Iâve been providing hosting, infrastructure, design and development services since 1995, long before HTML was even thought of for emails. You have non universal HTML in your template, such as . There are others in there too, however I i
I shall simplify my previous suggestion. When you are trying something new, Keep It Simple. Donât blast in there 750 lines of code. If you encounter a problem, try something simple and add complexity. And when people give you a polite heads up and basic troubleshooting steps to try to get to the bottom of your issue, remember theyâve possibly got 20 years more professional experience that they are drawing upon.
InvoicePlane is a very customisable Invoice and Quotation system, it is not a rich mail system or marketing mailer, But it is the best Open Source solution for Invoices and Quotes.
It can also produce decent results in terms of email formatting if you understand how to code in the version of HTML widely adopted in Email, and thatâs not MSXML or HTML5 based. There are roughly 26 universally accepted HTML tags for email, and roughly 46 universally accepted CSS tags. If you are going beyond that, you are producing bloated code that was never intended for email, just like Outlook. Itâs HTML capabilities use more than universal HTML too, much of which is discarded by non-Outlook mail clients.
Well, I just meant youâre being critical towards my code in this context, please donât take it personal. Iâm really thankful for your help.
I know what you meant with your reply. I also wouldnât use Outlook to send complex mails though I mean, if an app isnât meant for such a complex task atm, then youâve got 2 choices, I guess. Either live with it and adapt your code to a simpeler version or change the app so that it can deal with the complexity. I just prefer the latter ^^
Indeed you would have to adapt your templates and wait for for the Email Template implementation that supports full-HTML emails including the head (which is already planned but kinda huge feature that takes a lot of time to develop).
My apologies for how my reply read. There was no offence taken or meant . I was merely imparting my experience of changes in âthe Internetâ; perhaps Iâve seen too much! Iâm now the old it geek who sits in the corner groaning lol!
The deprecations in PHP7 are a prime example of change / impact; it has taken about 7 years to remove mysql_connect in favour of PDO and MySQLi; even then, some places are still not ready!
There has never been a formal âHTML email standardâ, and the main supported commands mirror the functionality of Rich Text. Outlook is the best example of the lack of standards, most of what it sends is nothing but pointless traffic to most other clients. It is also the most accepting client, as it covers most current HTML standards. It all adds bulk to the amount of data transported across the internet, and SMTP isnât really designed to handle a lot of data in one go. It should be possible to create your chosen effect using external calls, but that can also be problematic and time consuming.
Fortunately, @Kovah and the devs are on it, but I dont envy their task. Ultimately, they will be adding another potential schema to the mix until someone comes up with a unified standard .