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
9c697ddc
authored
Mar 29, 2018
by
Urvil Shah
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Show the status of the Email Receiving and sending.
parent
99044bfb
Pipeline
#7199
passed with stages
in 22 minutes 38 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
9 deletions
Mobile.Search.Web/Controllers/TemplateController.cs
Mobile.Search.Web/Views/Template/FroalaIndex.cshtml
Mobile.Search.Web/Controllers/TemplateController.cs
View file @
9c697ddc
...
...
@@ -151,8 +151,16 @@ namespace Mobile.Search.Web.Controllers
if
(
isSendEmail
)
{
sendEmail
(
value
,
EmailId
);
return
View
();
if
(
sendEmail
(
value
,
EmailId
))
{
return
Json
(
new
{
status
=
"Success"
});
}
else
{
return
Json
(
new
{
status
=
"Failed"
});
}
}
else
{
...
...
@@ -174,7 +182,7 @@ namespace Mobile.Search.Web.Controllers
return
View
();
}
public
void
sendEmail
(
string
value
,
string
email_id
)
public
bool
sendEmail
(
string
value
,
string
email_id
)
{
MailAddress
from
=
new
MailAddress
(
FromEmail
,
"TemplateTest"
);
MailAddress
to
=
new
MailAddress
(
email_id
);
...
...
@@ -187,13 +195,17 @@ namespace Mobile.Search.Web.Controllers
try
{
client
.
Send
(
message
);
return
true
;
}
catch
(
Exception
ex
)
{
Console
.
WriteLine
(
"Exception caught in CreateTestMessage4(): {0}"
,
ex
.
ToString
());
return
false
;
}
return
true
;
}
...
...
Mobile.Search.Web/Views/Template/FroalaIndex.cshtml
View file @
9c697ddc
...
...
@@ -125,6 +125,11 @@
<strong>
Email to :
<u><strong
id=
"email_id"
></strong></u>
Send Successfully
</strong>
</div>
</div>
<div
id=
"sent_to_email_failed"
>
<div
class=
"alert alert-success"
role=
"alert"
>
<strong>
Email to :
<u><strong
id=
"email_id_failed"
></strong></u>
Send Failed
</strong>
</div>
</div>
<!-- <iframe width="375" height="650" src="/search/template?templateKey=@Model.Key&keyword=audi+a4&debug=true" style="border: solid 1px black; margin: auto"></iframe>-->
</div>
...
...
@@ -224,6 +229,7 @@
//});
$
(
document
).
ready
(
function
()
{
$
(
'#sent_to_email'
).
hide
();
$
(
'#sent_to_email_failed'
).
hide
();
$
.
get
(
"/Template/S3Signature"
,
{})
.
done
(
function
(
data
)
{
$
(
'#FroalaHtmlEditor'
).
froalaEditor
({
...
...
@@ -257,12 +263,20 @@
dataType
:
"json"
,
traditional
:
true
,
contentType
:
"application/json; charset=utf-8"
,
complete
:
function
()
{
$
(
'#email_id'
).
empty
().
append
(
EmailId
);
$
(
'#sent_to_email'
).
show
();
document
.
getElementById
(
"EmailId"
).
value
=
""
}
success
:
function
(
data
)
{
if
(
data
.
status
==
"Success"
)
{
$
(
'#sent_to_email_failed'
).
hide
();
$
(
'#email_id'
).
empty
().
append
(
EmailId
);
$
(
'#sent_to_email'
).
show
();
document
.
getElementById
(
"EmailId"
).
value
=
""
}
else
{
$
(
'#sent_to_email'
).
hide
();
$
(
'#email_id_failed'
).
empty
().
append
(
EmailId
);
$
(
'#sent_to_email_failed'
).
show
();
document
.
getElementById
(
"EmailId"
).
value
=
""
}
}
});
...
...
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