Skip to content

Commit

Permalink
Fix for pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Defebvre committed Feb 18, 2015
1 parent 0fa99a8 commit 82a2827
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions applications/teletype/src/teletype_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ find_addresses(DataJObj, TemplateMetaJObj, ConfigCat) ->
AddressKeys = [<<"to">>, <<"cc">>, <<"bcc">>, <<"from">>, <<"reply_to">>],
find_addresses(DataJObj, TemplateMetaJObj, ConfigCat, AddressKeys, []).

find_addresses(_, _, _, [], Acc) -> Acc;
find_addresses(_DataJObj, _TemplateMetaJObj, _ConfigCat, [], Acc) -> Acc;
find_addresses(DataJObj, TemplateMetaJObj, ConfigCat, [Key|Keys], Acc) ->
find_addresses(
DataJObj
Expand Down Expand Up @@ -966,10 +966,9 @@ find_address(DataJObj, _TemplateMetaJObj, ConfigCat, Key, ?EMAIL_ADMINS) ->
lager:debug("looking for admin emails for '~s'", [Key]),
{Key, find_admin_emails(DataJObj, ConfigCat, Key)}.


-spec find_address(wh_json:key(), wh_json:object(), wh_json:object()) -> api_binaries().
find_address(Key, DataJObj, TemplateMetaJObj) ->
case wh_json:get_value(Key, DataJObj) of
[] -> wh_json:get_value(Key, TemplateMetaJObj);
case wh_json:get_ne_value(Key, DataJObj) of
'undefined' -> wh_json:get_value(Key, TemplateMetaJObj);
Emails -> Emails
end.
Expand Down

0 comments on commit 82a2827

Please sign in to comment.