It would be cool to have an archive with all sent newsletters, perhaps with additional information such as sending date and recipients.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hansfn’s picture

You can do this using Rules. Views Send defines three events that you can use in Rules. Using the "After sending an individual email" event you can store everything about the message into a custom content type. Below is an example that just stores the title and body of the message as an article:

{ "rules_views_send_sent" : {
    "LABEL" : "Views Send Sent",
    "PLUGIN" : "reaction rule",
    "ACTIVE" : false,
    "REQUIRES" : [ "rules", "views_send" ],
    "ON" : [ "views_send_email_sent" ],
    "DO" : [
      { "entity_create" : {
          "USING" : {
            "type" : "node",
            "param_type" : "article",
            "param_title" : "E-mail sent [site:current-date] to [views-send-email-message:to_mail]: [views-send-email-message:subject]",
            "param_author" : "1"
          },
          "PROVIDE" : { "entity_created" : { "mail_log_entity" : "Mail log" } }
        }
      },
      { "data_set" : {
          "data" : [ "mail-log-entity:body:value" ],
          "value" : "[views-send-email-message:body]"
        }
      }
    ]
  }
}
balumba’s picture

Perfect, thanks!

hansfn’s picture

Status: Active » Closed (fixed)

Great that it worked for you.