• Resolved LymeSimon

    (@smotsie)


    Hi code people,

    I have just discovered this brilliant plugin (congrats, it’s VERY useful) and wanted to send a custom email with a “donate” button in it, on a “Pay as you feel” product. The ideal button is in a PayPal form which cannot easily be done through a link.

    Reading previous posts here (and understanding code), I edited admin/class-custom-woocommerce-field.php and made this addition:

                       $allowed_html = array(
                           'form' => array(
                                    'action' => array(),
                                    'method' => array(),
                                    'style' => array(),
                                    'target' => array()
                                    ),
                            'button' => array(
                                    'name' => array(),
                                    'type' => array(),
                                    'value' => array()
                                    ),
                            'input' => array(
                                    'name' => array(),
                                    'type' => array(),
                                    'value' => array()
                                    ),
    ...

    This is great and works as I need, but if there is an update to the plugin it will disappear. Might there be a way to customise the allowed html in a file that persists after such an upgrade?

    Cheers
    LymeSimon

Viewing 1 replies (of 1 total)
  • Plugin Author alexmustin

    (@alexmustin)

    Hi LymeSimon,

    That is a fantastic question, and a great idea.

    I will research how to create a hook here, so users can write a function which will modify or add to the ‘allowed_html’ array. This should be in the next update, and I’ll be sure to provide simple instructions.

    Although for your particular use case, I would recommend looking into which email clients can actually support using HTML forms inside an email… On the MailChimp website they say not to do so because:

    The elements are blocked by nearly all major email clients. Support is either extremely limited, or nonexistent.

    https://kb.mailchimp.com/campaigns/design/limitations-of-html-email#Do-Not-Use

Viewing 1 replies (of 1 total)
  • The topic ‘Other HTML allowed in emails’ is closed to new replies.