Guest User

Untitled

a guest
Oct 25th, 2018
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. diff --git a/server/components/utils/index.js b/server/components/utils/index.js
  2. index 07919ddf..e7d5452f 100644
  3. --- a/server/components/utils/index.js
  4. +++ b/server/components/utils/index.js
  5. @@ -51,8 +51,7 @@ util.initBase = function (){
  6. });
  7.  
  8. keyVault.getSecret(config.sendGridConfigKey, function (_sendGridConfig) {
  9. -
  10. - sendGridConfig = {"apiKey":"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"};
  11. + sendGridConfig = JSON.parse(_sendGridConfig.value);
  12. sgMail.setApiKey(sendGridConfig.apiKey);
  13. }
  14. );
  15. @@ -112,10 +111,6 @@ util.sendEmail = function(options, user){
  16. };
  17. }
  18.  
  19. - console.log('-------------------------------------');
  20. - console.log('mailOptions', mailOptions);
  21. - console.log('-------------------------------------');
  22. -
  23. return sgMail.send(mailOptions).then(()=>{
  24. logger('info',`mail sent successfully to ${mailOptions.to}`, user);
  25. })
  26. diff --git a/server/config/environment/index.js b/server/config/environment/index.js
  27. index 40432828..d4f49e9c 100644
  28. --- a/server/config/environment/index.js
  29. +++ b/server/config/environment/index.js
  30. @@ -100,7 +100,7 @@ var all = {
  31. //sendgrid config key
  32. sendGridConfigKey:"sendgrid-config",
  33.  
  34. - mailSandboxMode:false,//set this to false if you want to actually send emails via sendGrid from your environment
  35. + mailSandboxMode:true,//set this to false if you want to actually send emails via sendGrid from your environment
  36.  
  37. domain: process.env.DOMAIN || 'processgridappqa.com',
  38.  
  39. diff --git a/server/services/salesforce/salesforceConnectionFactory.js b/server/services/salesforce/salesforceConnectionFactory.js
  40. index 669a8ec8..3333b340 100644
  41. --- a/server/services/salesforce/salesforceConnectionFactory.js
  42. +++ b/server/services/salesforce/salesforceConnectionFactory.js
  43. @@ -182,15 +182,11 @@ salesforceConnectionFactory.insertLeadInLMO = function(user){
  44.  
  45. let LMOLoginObj = JSON.parse(config.LMOLogin);
  46.  
  47. - console.log('-------------------------------------');
  48. - console.log('LMOLoginObj', LMOLoginObj);
  49. - console.log('-------------------------------------');
  50. -
  51. return sfConn.soapLogin({
  52. hostname: LMOLoginObj.hostname,
  53. apiVersion: salesforceConnectionFactory.salesforceAPIVersion,
  54. - username: /*LMOLoginObj.username,*/ 'appbuddy_info@appbuddy.com.CopyRecord',
  55. - password: /*LMOLoginObj.password + LMOLoginObj.securityToken*/ 'BigSales2018$$' + '7avzxGnoAkP278xyCoBPH3THy',
  56. + username: LMOLoginObj.username,
  57. + password: LMOLoginObj.password + LMOLoginObj.securityToken
  58. }).then(soapConnection=>{
  59.  
  60. logger('info','* services.salesforce.salesforceConnectionFactory.insertLeadInLMO: successfully created new soap connection', user);
  61. @@ -278,15 +274,12 @@ salesforceConnectionFactory.activateLeadInLMO = function(user){
  62. let leadToActivate = {
  63. '$type': 'Lead',
  64. 'ABC_Activated__c': 'true',
  65. - 'Id': user.email
  66. + 'Id': user.LMOLeadId
  67. };
  68.  
  69. // Update the Lead in the LMO
  70. return sfConn.soap(partnerWsdl, 'update', {sObjects: [leadToActivate]})
  71. .then(result =>{
  72. - console.log('-------------------------------------');
  73. - console.log('result', result);
  74. - console.log('-------------------------------------');
  75. return sfConn;
  76. });
Add Comment
Please, Sign In to add comment