Skip to content

Commit

Permalink
WHISTLE-11: add transcription to the template payload, if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
James Aimonetti committed Jul 30, 2012
1 parent adaa9d7 commit a875a22
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion whistle_apps/apps/notify/src/notify_vm.erl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ handle_req(JObj, _Props) ->
CustomSubjectTemplate = wh_json:get_value([<<"notifications">>, <<"voicemail_to_email">>, <<"email_subject_template">>], AcctObj),
{ok, Subject} = notify_util:render_template(CustomSubjectTemplate, ?DEFAULT_SUBJ_TMPL, Props),

build_and_send_email(TxtBody, HTMLBody, Subject, Email, [ KV || {_, V}=KV <- Props, V =/= undefined ])
build_and_send_email(TxtBody, HTMLBody, Subject, Email
,props:filteR_undefined(Props)
)
end.

%%--------------------------------------------------------------------
Expand Down Expand Up @@ -95,6 +97,7 @@ create_template_props(Event, Docs, Account) ->
,{<<"to_realm">>, wh_json:get_value(<<"To-Realm">>, Event)}
,{<<"voicemail_box">>, wh_json:get_value(<<"Voicemail-Box">>, Event)}
,{<<"voicemail_media">>, wh_json:get_value(<<"Voicemail-Name">>, Event)}
,{<<"voicemail_transcription">>, wh_json:get_value(<<"Voicemail-Transcription">>)}
,{<<"call_id">>, wh_json:get_value(<<"Call-ID">>, Event)}
]}
,{<<"account_db">>, wh_json:get_value(<<"pvt_account_db">>, Account)}
Expand Down

0 comments on commit a875a22

Please sign in to comment.