Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(String username :listmaker.keySet()){
- if(username != null){
- sendgridsettings__c sendSetting = sendgridsettings__c.getInstance(username);
- system.debug(sendSetting);
- // Storing parameters to a call as separate parameters can make things a
- // bit easier to read...but do incur a small amount of overhead.
- // I chose to serialize your payload data inline (as opposed to storing in
- // a separate variable), but it really doesn't make any difference.
- // Use whatever you're more comfortable with (again, _be consistent_)
- SendGridAPI.sendRequest(json.serialize(listmaker.get(username)),
- '/v3/contactdb/lists/' + sendSetting.list_id__c + '/recipients',
- 'POST');
- }
- else{
- string usernames = 'Roger';
- sendgridsettings__c sendSetting = sendgridsettings__c.getInstance(usernames);
- system.debug(sendSetting);
- // Storing parameters to a call as separate parameters can make things a
- // bit easier to read...but do incur a small amount of overhead.
- // I chose to serialize your payload data inline (as opposed to storing in
- // a separate variable), but it really doesn't make any difference.
- // Use whatever you're more comfortable with (again, _be consistent_)
- SendGridAPI.sendRequest(json.serialize(listmaker.get(usernames)),
- '/v3/contactdb/lists/' + sendSetting.list_id__c + '/recipients',
- 'POST');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement