Permalink
Browse files

Added support for Message Variables and corresponding documentation

  • Loading branch information...
1 parent 8be985e commit 4399e122511bcbd7436520b879239ed7f0d96306 @JonLim JonLim committed Jul 7, 2011
Showing with 19 additions and 0 deletions.
  1. +17 −0 README.md
  2. +2 −0 lib/postageapp.js
View
@@ -45,6 +45,16 @@ Recipients can be passed along as a single string or as an array.
recipients = "email@address.com";
recipients = ["email1@address.com", "email2@address.com"];
+If you wish to set Message Variables for each individual recipient, you just have to pass an array for each recipient.
+
+ recipients = {
+ "email@example.com": {
+ 'variable': 'Value'
+ },
+ "email2@example.com": {
+ 'variable': 'Another Value'
+ }};
+
Content will accept an array for HTML and plain text content. If it is a string, it will assume that you are naming a template.
content = {
@@ -62,5 +72,12 @@ If you are using a template name with defined subject and from values, just set
subject = null;
from = null;
+
+Message Variables needs to have an array passed into it with the variable names and values.
+
+ variables = {
+ 'variable': 'Variable value',
+ 'variable2': 'Another variable'
+ };
For more information about formatting of recipients, templates and variables please see [documentation](http://help.postageapp.com/kb/api/send_message)
View
@@ -42,6 +42,8 @@ var postageapp = module.exports = {
template: templateName,
+ variables: emailVariables
+
}
}

0 comments on commit 4399e12

Please sign in to comment.