From 8460f91b1c455676d8dcc30cf7a3ed37527cc2b2 Mon Sep 17 00:00:00 2001 From: iamigo Date: Tue, 2 Sep 2014 12:28:07 -0700 Subject: [PATCH] Fix Substitutions Make "sub" a Map> and update the addSubstitution method and setSubstitutions methods accordingly. --- src/classes/Smtpapi.cls | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/classes/Smtpapi.cls b/src/classes/Smtpapi.cls index a041fe9..082644d 100644 --- a/src/classes/Smtpapi.cls +++ b/src/classes/Smtpapi.cls @@ -3,7 +3,7 @@ global class Smtpapi { global class Header { public List to = new List(); - public Map sub = new Map(); + public Map> sub = new Map>(); public Map unique_args = new Map(); public List category = new List(); public Map section = new Map(); @@ -57,14 +57,11 @@ global class Smtpapi { } public Header addSubstitution(String key, List val) { - for (Integer i = 0; i < val.size(); i++) { - List val_in_array = new List { val[i] }; - this.sub.put(key, val_in_array); - } + this.sub.put(key, val); return this; } - public Header setSubstitutions(Map substitutions) { + public Header setSubstitutions(Map> substitutions) { this.sub = substitutions; return this; } @@ -117,4 +114,4 @@ global class Smtpapi { return this; } } -} \ No newline at end of file +}