1

I have a rule component set up that currently sends an HTML email. I need to change the body of the email to include a new field, but when I do and press Save, it doesn't return to the Rule page, it just goes to the top of the page and loses the changes I've made.

If I overwrite the HTML with a simple piece of text or a small piece of HTML, it works OK.

I'm wondering if there's some validation going on, but there are no error messages displayed or in the logs. I've validated the html through the W3C Validation Service and cleaned it up so there are only a couple of warnings.

My other thought is that maybe there's some limit that I've hit? The HTML is quite long, as it was generated by an online generator.

I can't include an export of the rule as it's too big for this message.

Any help?

I am using Drupal 7.59 and Rules v7.x-2.10; MimeMail v7.x-1.0. Have tried the latest dev version MimeMail too, but made no difference.

0

2 Answers 2

1

Thanks Pierre for your suggestion. I didn't need to try it, but it makes a lot of sense. Wish I'd have thought of it!

In the end (before I saw your suggestion), I rebuilt the email using a different generator tool, which seemed to produce much smaller and cleaner HTML. This works OK. It looks like there was either a problem with the HTML or there is some kind of limit on length.

0

You could try to add 2 Rules Actions, something like so:

  • Add a variable of type text
  • Set a data value for that variable, with value the HTML string.

While doing so, you have the Rules power available to include any relevant conditional logic. And if you then use the "replacement tokens" within the "Message type" you're working with (to make the value of your new variable available as a token in the message you want to create), you should be good to go.

Did I mention there is zero custom code involved?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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