Skip to content

Commit 5b59d56

Browse files
author
Tim Noel
committed
MA-1155 #time 20m Changed sparkpost to SparkPost
1 parent 4e1cf4d commit 5b59d56

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

lib/SendGridCompatibility/Email.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function Email(options){
1212
}
1313

1414
/**
15-
* Sendgrid email compatibility functions
15+
* SendGrid email compatibility functions
1616
*
1717
* @param Most have a single value to map
1818
* Add functions will often contain a key / value pair
@@ -70,31 +70,31 @@ Email.prototype.addSection = function (key, value){
7070
Email.prototype.setSections = function (sections){
7171
this.section = sections;
7272
};
73-
// Sparkpost doesn't currently support addUniqueArg, throw an error
73+
// SparkPost doesn't currently support addUniqueArg, throw an error
7474
Email.prototype.addUniqueArg = function (){
7575
throw new Error('Unique Argument compatibility is not supported.');
7676
};
77-
// Sparkpost doesn't currently support setUniqueArgs, throw an error
77+
// SparkPost doesn't currently support setUniqueArgs, throw an error
7878
Email.prototype.setUniqueArgs = function (){
7979
throw new Error('Unique Argument compatibility is not supported.');
8080
};
81-
// Sparkpost doesn't currently support addCategory, throw an error
81+
// SparkPost doesn't currently support addCategory, throw an error
8282
Email.prototype.addCategory = function (){
8383
throw new Error('Category compatibility is not supported.');
8484
};
85-
// Sparkpost doesn't currently support setCategories, throw an error
85+
// SparkPost doesn't currently support setCategories, throw an error
8686
Email.prototype.setCategories = function (){
8787
throw new Error('Category compatibility is not supported.');
8888
};
89-
// Sparkpost doesn't currently support addFilter, throw an error
89+
// SparkPost doesn't currently support addFilter, throw an error
9090
Email.prototype.addFilter = function (){
9191
throw new Error('Filter compatibility is not supported.');
9292
};
93-
// Sparkpost doesn't currently support setFilters, throw an error
93+
// SparkPost doesn't currently support setFilters, throw an error
9494
Email.prototype.setFilters = function (){
9595
throw new Error('Filter compatibility is not supported.');
9696
};
97-
// Sparkpost doesn't currently support addFile, throw an error
97+
// SparkPost doesn't currently support addFile, throw an error
9898
Email.prototype.addFile = function (){
9999
throw new Error('File compatibility is not supported.');
100100
};

lib/SendGridCompatibility/index.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ var transmission = require('../transmission');
44
var configuration = require('../configuration');
55

66
/**
7-
* Sendgrid compatibility constructor
7+
* SendGrid compatibility constructor
88
* Responsible for taking the api key and config options and
9-
* translating them into a format compatible with sparkpost's
9+
* translating them into a format compatible with SparkPost's
1010
* configuration.setConfig function.
1111
*
12-
* @param username: dropped sendgrid username string
12+
* @param username: dropped SendGrid username string
1313
* @param apiKey: api key string
1414
* @param options: optional additional options object
1515
*/
@@ -25,10 +25,10 @@ var sendgrid = function(username, apiKey, options) {
2525
};
2626

2727
/**
28-
* Private Method for translating a user's sendgrid config options
29-
* to a sparkpost compatible set by dropping unnecessary data
28+
* Private Method for translating a user's SendGrid config options
29+
* to a SparkPost compatible set by dropping unnecessary data
3030
*
31-
* @param payload: sendgrid formatted config options object
31+
* @param payload: SendGrid formatted config options object
3232
* @returns object: config options with incompatible entries removed
3333
*/
3434
var translateConfig = function(options) {
@@ -46,12 +46,12 @@ var translateConfig = function(options) {
4646
};
4747

4848
/**
49-
* Private Method for translating a user's sendgrid substitutions and sections
50-
* to a consolidated sparkpost substitutionData object
49+
* Private Method for translating a user's SendGrid substitutions and sections
50+
* to a consolidated SparkPost substitutionData object
5151
*
52-
* @param payload: sendgrid formatted object or sendgrid Email object to
53-
* be translated into a sparkpost payload
54-
* @returns object: substitutionData object as per sparkpost payload format
52+
* @param payload: SendGrid formatted object or SendGrid Email object to
53+
* be translated into a SparkPost payload
54+
* @returns object: substitutionData object as per SparkPost payload format
5555
*/
5656
var consolidateSubstitutionData = function(payload) {
5757
var substitutionData = {};
@@ -66,12 +66,12 @@ var consolidateSubstitutionData = function(payload) {
6666
};
6767

6868
/**
69-
* Private Method for translating a user's sendgrid to and toname to a recipients
69+
* Private Method for translating a user's SendGrid to and toname to a recipients
7070
* array that the transmissions "Class" can understand
7171
*
72-
* @param payload: sendgrid formatted object or sendgrid Email object to
73-
* be translated into a sparkpost payload
74-
* @returns array: recipients array as per sparkpost payload format
72+
* @param payload: SendGrid formatted object or SendGrid Email object to
73+
* be translated into a SparkPost payload
74+
* @returns array: recipients array as per SparkPost payload format
7575
*/
7676
var parseTo = function(payload){
7777
var recipients = [];
@@ -93,12 +93,12 @@ var parseTo = function(payload){
9393
};
9494

9595
/**
96-
* Private Method for translating a user's sendgrid payload to a format
96+
* Private Method for translating a user's SendGrid payload to a format
9797
* that the transmissions "Class" can understand
9898
*
99-
* @param payload: sendgrid formatted object or sendgrid Email object to
100-
* be translated into a sparkpost payload
101-
* @returns object: translation from sendgrid payload to sparkpost payload
99+
* @param payload: SendGrid formatted object or SendGrid Email object to
100+
* be translated into a SparkPost payload
101+
* @returns object: translation from SendGrid payload to SparkPost payload
102102
*/
103103
var translatePayload = function(payload) {
104104
var sub = consolidateSubstitutionData(payload)
@@ -132,8 +132,8 @@ var translatePayload = function(payload) {
132132
* private helper methods to translate an Email or inline object
133133
* and then pass that content to the transmissions send function.
134134
*
135-
* @param payload: sendgrid formatted object or sendgrid Email object to
136-
* be translated into a sparkpost payload and sent
135+
* @param payload: SendGrid formatted object or SendGrid Email object to
136+
* be translated into a SparkPost payload and sent
137137
*/
138138
sendgrid.prototype.send = function(payload, callback) {
139139
var translated = translatePayload(payload);

0 commit comments

Comments
 (0)