Wylio / meteor-mandrill

Meteor package for sending email via Mandrill
https://atmospherejs.com/wylio/mandrill
32 stars 8 forks source link

Metadata #19

Closed appjitsu closed 8 years ago

appjitsu commented 8 years ago

Does sending metadata work with this release? I am having trouble seeing the metadata in either the mandrill admin or on an api webhook.

Mandrill.messages.sendTemplate({
      'template_name': 'newProspectTest',
      'template_content': [],
      'message': {
        subject: "New Prospect Test",
        'from_email': Meteor.settings.mandrill.from_email,
        'from_name': Meteor.settings.mandrill.from_name,
        to: [{
          email: user.emails[0].address,
          name: (user.profile) ? user.profile.firstName : user.emails[
            0].address
        }],
        'global_merge_vars': [{
          name: 'NAME',
          content: (user.profile) ? user.profile.firstName : ""
        }, {
          name: 'SUPPORTEMAIL',
          content: Meteor.settings.mandrill.from_email
        }, {
          name: 'URL',
          content: process.env.ROOT_URL + "sales/prospects/" +
            prospect._id
        }],
        'metadata': {
          prospectId: prospect._id,
          title: prospect.title,
          prospect: prospect,
          environment: process.env.NODE_ENV,
          rootUrl: process.env.ROOT_URL
        },
      }
    });
appjitsu commented 8 years ago

I talked with Mandrill support and they said "each message's metadata is limited to 200 bytes of JSON-encoded data". I was basically sending too much data.