1

I have a local site I am testing. I have PhPMailer installed which works fine to send plain text email with the Sender name populated properly. However when I installed MimeMail and try to use the same rule, except using action send HTML mail, the Sender name no longer appears. Any help would be great.

{ "rules_entityform_client_confirmation_email" : {
"LABEL" : "Entityform Client Confirmation Email",
"PLUGIN" : "rule",
"OWNER" : "rules",
"TAGS" : [ "entity_rules_entityform_submission" ],
"REQUIRES" : [ "rules", "mimemail" ],
"USES VARIABLES" : {
  "entity" : { "label" : "Entity", "type" : "entityform" },
  "continue" : { "label" : "Continue Rules", "type" : "boolean" }
},
"IF" : [
  { "user_has_role" : { "account" : [ "entity:user" ], "roles" : { "value" : { "4" : "4" } } } }
],
"DO" : [
  { "drupal_message" : { "message" : "Email to: [entity:user:mail]\r\nHi [entity:user],\r\nThanks for creating a new project\r\n" } },
  { "mimemail" : {
      "USING" : {
        "key" : [ "entity:entityform-id" ],
        "to" : [ "entity:user:mail" ],
        "from_name" : "[site:name]",
        "subject" : "New Project Created",
        "body" : "Hi [entity:user],\r\nThanks for creating a new project",
        "plaintext" : "Hi [entity:user],\r\nThanks for creating a new project",
        "language" : [ "" ]
      },
      "PROVIDE" : { "send_status" : { "send_status" : "Send status" } }
    }
  }
],
"PROVIDES VARIABLES" : [ "continue" ]
}
}
1

Try this variation of your rule (using the rules UI to import it in your site):

{ "rules_entityform_client_confirmation_email_pv" : {
"LABEL" : "Entityform Client Confirmation Email PV",
"PLUGIN" : "rule",
"OWNER" : "rules",
"TAGS" : [ "entity_rules_entityform_submission" ],
"REQUIRES" : [ "rules", "mimemail" ],
"USES VARIABLES" : {
  "entity" : { "label" : "Entity", "type" : "entityform" },
  "continue" : { "label" : "Continue Rules", "type" : "boolean" }
},
"IF" : [
  { "user_has_role" : { "account" : [ "entity:user" ], "roles" : { "value" : { "4" : "4" } } } }
],
"DO" : [
  { "drupal_message" : { "message" : "Email to: [entity:user:mail]\r\nHi [entity:user],\r\nThanks for creating a new project\r\n" } },
  { "mimemail" : {
      "USING" : {
        "key" : [ "entity:entityform-id" ],
        "to" : [ "entity:user:mail" ],
        "from_name" : "[site:name]",
        "from_mail" : "somebody@example.com",
        "subject" : "New Project Created",
        "body" : "Hi [entity:user],\r\nThanks for creating a new project",
        "plaintext" : "Hi [entity:user],\r\nThanks for creating a new project",
        "language" : [ "" ]
      },
      "PROVIDE" : { "send_status" : { "send_status" : "Send status" } }
    }
  }
],
"PROVIDES VARIABLES" : [ "continue" ]
}
}

The only difference with your exported rule is the line with from_mail that is added (and a slightly different machine name of your rule). Adapt the eMail Id I used to fit your needs.

  • Thanks Pierre - I thought the rule was supposed to automatically pick up both the sender email and name from the sitewide name and address, but I guess not because this works :) – Sharon Dankwardt Oct 3 '17 at 20:57
  • @SharonDankwardt merci for the update (and accept / +1). Yes rules can sometimes be a little bit tricky. But apart from that It's an amazing module! Next ( Rules ) question? – Pierre.Vriens Oct 3 '17 at 21:01
  • I'm sure I'll be back if I have more questions :) Thanks Pierre – Sharon Dankwardt Oct 3 '17 at 22:18

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.