Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plain text version of shop e-mails are cluttered with HTML and styles #826

Open
thomasbnielsen opened this issue May 17, 2024 · 0 comments

Comments

@thomasbnielsen
Copy link
Contributor

All emails sent out from Silvershop are missing plain text versions, or rather they are poorly formatted.
The styles and HTML inside the plain version of these e-mails are a red flag for spam filters.

Suggest we make plan text versions of all e-mails and set those like: $email->setPlainTemplate($html_template . 'Plain'); or revisit how we strip HTML and Styles from the HTML version into a plain version.

The solution we did for a project was making an extension for OrderEmailNotifier, for the hook "updateClientEmail"

class OrderEmailNotifierExtension extends DataExtension
{
    public function updateClientEmail(Email $email)
    {
        $order = $email->getData()->Order;

        $html_template = $email->getHTMLTemplate();
        if($html_template == 'SilverShop/Model/Order_ReceiptEmail') {
            $email->setPlainTemplate($html_template . 'Plain');
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant