Commit b8aff26c by Julia Hansbrough Committed by Brian Wilson

Merged in email confirmation modal

parent 3f88b879
......@@ -23,7 +23,17 @@ class SendEmail
@$btn_send.click =>
success_message = gettext('Your email was successfully queued for sending.')
if @$subject.val() == ""
alert gettext("Your message must have a subject.")
else if @$emailEditor.save()['data'] == ""
alert gettext("Your message cannot be blank.")
else
send_to = @$send_to.val().toLowerCase()
if send_to == "myself"
send_to = gettext("yourself")
subject = gettext(@$subject.val())
confirm_message = gettext("You are about to send an email titled \"#{subject}\" to #{send_to}. Is this OK?")
if confirm confirm_message
send_data =
action: 'send'
......@@ -36,7 +46,7 @@ class SendEmail
dataType: 'json'
url: @$btn_send.data 'endpoint'
data: send_data
success: (data) => @display_response ("<div class=\"msg msg-confirm\"><p class=\"copy\">" + success_message + "</p></div>")
success: (data) => @display_response gettext('Your email was successfully queued for sending.')
error: std_ajax_err => @fail_with_error gettext('Error sending email.')
fail_with_error: (msg) ->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment