Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Urvil Shah
/
MobEasyEditor
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Registry
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
47262405
authored
Apr 02, 2018
by
Urvil Shah
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Send Email Via Send grid.
parent
b4c93d26
Pipeline
#7245
passed with stages
in 23 minutes 10 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
5 deletions
Mobile.Search.Web/Controllers/TemplateController.cs
Mobile.Search.Web/Web.config
Mobile.Search.Web/Controllers/TemplateController.cs
View file @
47262405
...
...
@@ -26,7 +26,11 @@ namespace Mobile.Search.Web.Controllers
private
readonly
Dynamo
_dynamoClient
;
private
static
readonly
string
AwsAccessKey
=
ConfigUtilities
.
GetAppSetting
(
"AWSAccessKey"
);
private
static
readonly
string
AwsSecretKey
=
ConfigUtilities
.
GetAppSetting
(
"AWSSecretKey"
);
private
static
readonly
string
SmtpHost
=
ConfigUtilities
.
GetAppSetting
(
"SMTPHost"
);
private
static
readonly
string
SmtpMinboxHost
=
ConfigUtilities
.
GetAppSetting
(
"SMTPMinboxHost"
);
private
static
readonly
string
SmtpSendGridHost
=
ConfigUtilities
.
GetAppSetting
(
"SMTPSendGridHost"
);
private
static
readonly
string
SmtpSendGridUsername
=
ConfigUtilities
.
GetAppSetting
(
"SMTPSendGridUser"
);
private
static
readonly
string
SmtpSendGridPassword
=
ConfigUtilities
.
GetAppSetting
(
"SMTPSendGridPass"
);
private
static
readonly
int
Port
=
int
.
Parse
(
ConfigUtilities
.
GetAppSetting
(
"Port"
));
private
static
readonly
string
FromEmail
=
ConfigUtilities
.
GetAppSetting
(
"FromMailAddress"
);
...
...
@@ -142,6 +146,7 @@ namespace Mobile.Search.Web.Controllers
{
try
{
string
url
=
"http://config.minbox.email/Offer/Create/"
;
var
d
=
new
Dictionary
<
string
,
object
>
{
{
"templateKey"
,
key
.
ToLower
()},
...
...
@@ -166,8 +171,10 @@ namespace Mobile.Search.Web.Controllers
{
_dynamoClient
.
WriteSingle
(
"prd_2click_templates"
,
d
);
}
url
=
url
+
key
;
return
RedirectToAction
(
"Index"
);
return
Redirect
(
url
);
}
catch
(
Exception
x
)
{
...
...
@@ -190,14 +197,33 @@ namespace Mobile.Search.Web.Controllers
message
.
Subject
=
"Template Testing Via Html Editor"
;
message
.
Body
=
value
;
message
.
IsBodyHtml
=
true
;
SmtpClient
client
=
new
SmtpClient
(
SmtpHost
);
SmtpClient
client
=
new
SmtpClient
();
client
.
Port
=
Port
;
if
(
email_id
.
Contains
(
"minbox"
))
{
client
.
Host
=
SmtpMinboxHost
;
}
else
{
client
.
Host
=
SmtpSendGridHost
;
System
.
Net
.
NetworkCredential
credentials
=
new
System
.
Net
.
NetworkCredential
(
SmtpSendGridUsername
,
SmtpSendGridPassword
);
client
.
Credentials
=
credentials
;
}
// client.Port = Port;
try
{
client
.
Send
(
message
);
return
true
;
}
catch
(
SmtpFailedRecipientException
ex
)
{
// ex.FailedRecipient and ex.GetBaseException() should give you enough info.
return
false
;
}
catch
(
Exception
ex
)
{
Console
.
WriteLine
(
"Exception caught in CreateTestMessage4(): {0}"
,
...
...
@@ -205,7 +231,6 @@ namespace Mobile.Search.Web.Controllers
return
false
;
}
return
true
;
}
...
...
Mobile.Search.Web/Web.config
View file @
47262405
...
...
@@ -11,6 +11,9 @@
<!--
For
more
information
on
Entity
Framework
configuration
,
visit
http
://
go
.
microsoft
.
com
/
fwlink
/?
LinkID
=
237468
--></
configSections
>
<
connectionStrings
>
<
add
name
=
"TopKeywordsRedshiftConnection"
connectionString
=
"Server=mobile-email.cejry5nesllx.us-west-2.redshift.amazonaws.com; Database=mobileemail; UID=mobsearch; PWD=44remember/TOKYO/shouted44; Port=5439"
/>
<
add
name
=
"EmailConfigCampaign"
connectionString
=
"data source=54.189.228.250;Initial Catalog=EmailConfig;Persist Security Info=True;User ID=campaign_management;Password=Children is learning!;MultipleActiveResultSets=True;App=EntityFramework;Connection Timeout=25"
providerName
=
"System.Data.SqlClient"
/>
<
add
name
=
"EmailConfig"
connectionString
=
"data source=54.189.228.250;Initial Catalog=EmailConfig;Persist Security Info=True;User ID=chuck;Password=Is our children learning?;MultipleActiveResultSets=True;App=EntityFramework;Connection Timeout=25"
providerName
=
"System.Data.SqlClient"
/>
<
add
name
=
"MobileEmailRedshift"
connectionString
=
"Server=mobile-email.cejry5nesllx.us-west-2.redshift.amazonaws.com; Database=mobileemail; UID=chuck; PWD=1Sourchildrenlearning?; Port=5439; Pooling=false;"
/>
</
connectionStrings
>
<
appSettings
>
<
add
key
=
"webpages:Version"
value
=
"3.0.0.0"
/>
...
...
@@ -30,7 +33,10 @@
<
add
key
=
"YahooSourceTag"
value
=
"adknowledge_mobile_1click_c_search"
/>
<
add
key
=
"AWSAccessKey"
value
=
"AKIAILPIR54LYZXOAXEA"
/>
<
add
key
=
"AWSSecretKey"
value
=
"8cLcx/0tHjIBGTxnfVp/hmFPoD6cTo19FG45rPeU"
/>
<
add
key
=
"SMTPHost"
value
=
"smtp.email.minbox.email"
/>
<
add
key
=
"SMTPMinboxHost"
value
=
"smtp.email.minbox.email"
/>
<
add
key
=
"SMTPSendGridHost"
value
=
"smtp.sendgrid.net"
/>
<
add
key
=
"SMTPSendGridUser"
value
=
"adkmobile"
/>
<
add
key
=
"SMTPSendGridPass"
value
=
"Sh0w me the money!"
/>
<
add
key
=
"Port"
value
=
"587"
/>
<
add
key
=
"FromMailAddress"
value
=
"offers@minbox.email"
/>
<!--
temp
for
stats
d
counters
-->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment