2

I am attempting to override the email templates for the Aheadworks_Giftcard extension. It seems that the email templates are defined in a xml file in the etc directory called sample_email_templates.xml.

Aheadworks/Giftcard/etc/sample_email_templates.xml snippet:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="sample_email_templates.xsd">
    <!-- todo: Need to be refactored to avoid data duplication. Difference between 'template_text' content in card image file name -->
    <template>
        <template_code>Christmas</template_code>
        <template_subject>You've been sent a gift from {{var sender_name}}</template_subject>
        <template_styles><![CDATA[img {
    max-width: 100%;
    height: auto;
    outline: none !important;
    border: 0 !important;
    text-decoration: none !important;
}
body {
    font-size: 16px;
    font-family: Arial, 'Helvetica', Helvetica, sans-serif;
    line-height: 1.5em;
    margin: 0;
    padding: 0;
    width: 100% !important;
    height: 100%;
    -webkit-text-size-adjust: none;
    background: #e1e1e1;
}]]></template_styles>
        <template_text><![CDATA[<table class="body-wrap" cellpadding="0" cellspacing="0" border="0" style="mso-table-lspace: 0; mso-table-rspace: 0; border-spacing: 0 !important; font-size: 16px; font-family: Arial, 'Helvetica', Helvetica, sans-serif; line-height: 1.5em; width: 100%; background: #e1e1e1; margin: 0; padding: 20px;">
    <tr style="font-size: 16px; font-family: Arial, 'Helvetica', Helvetica, sans-serif; line-height: 1.5em; margin: 0; padding: 0;">
        <td style="mso-table-lspace: 0; mso-table-rspace: 0; font-size: 16px; font-family: Arial, 'Helvetica', Helvetica, sans-serif; line-height: 1.5em; margin: 0; padding: 0;"></td>
        <td class="container first-container" style="mso-table-lspace: 0; mso-table-rspace: 0; font-size: 16px; font-family: Arial, 'Helvetica', Helvetica, sans-serif; line-height: 1.5em; clear: both !important; display: block !important; max-width: 560px !important; background: #f5f5f5; margin: 0 auto; padding: 20px;">

            <!-- content -->
            <div class="content" style="font-size: 16px; font-family: Arial, 'Helvetica', Helvetica, sans-serif; line-height: 1.5em; display: block; max-width: 560px; margin: 0 auto; padding: 0;">
                <table cellpadding="0" cellspacing="0" border="0" style="mso-table-lspace: 0; mso-table-rspace: 0; border-spacing: 0 !important; font-size: 16px; font-family: Arial, 'Helvetica', Helvetica, sans-serif; line-height: 1.5em; width: 100%; margin: 0; padding: 0;">
                    <tr style="font-size: 16px; font-family: Arial, 'Helvetica', Helvetica, sans-serif; line-height: 1.5em; margin: 0; padding: 0;">
                        <td class="center" style="mso-table-lspace: 0; mso-table-rspace: 0; font-size: 16px; font-family: Arial, 'Helvetica', Helvetica, sans-serif; line-height: 1.5em; text-align: center; margin: 0; padding: 0;" align="center">

                            <p class="gift-card-cover" style="font-size: 16px; font-family: Arial, 'Helvetica', Helvetica, sans-serif; line-height: 1.5em; margin: 0; padding: 0 0 20px;">
                                <img class="center" src="{{var card_image_base_url}}christmas.png"

I am not quite sure where to place the overridden sample_email_templates.xml with the updated email templates within the theme.

0

Not seen the code of module in question, but one approach would be to create a custom module, extend the block that loads the xml-file and point to your custom xml template. Then set your preference for your block in your modules di.xml. Don´t forget to set the original modules name in sequence on your module.xml.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.