Mailgun to support from= for consistency with email:// (#711)

This commit is contained in:
Chris Caron 2022-10-25 17:30:45 -04:00 committed by GitHub
parent c13bf84d03
commit b3cca772f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -160,6 +160,9 @@ class NotifyMailgun(NotifyBase):
'type': 'string',
'map_to': 'from_name',
},
'from': {
'alias_of': 'name',
},
'region': {
'name': _('Region Name'),
'type': 'choice:string',
@ -642,6 +645,12 @@ class NotifyMailgun(NotifyBase):
results['from_name'] = \
NotifyMailgun.unquote(results['qsd']['name'])
# Support from= for consistency with `mail://`
elif 'from' in results['qsd'] and len(results['qsd']['from']):
# Extract from name to associate with from address
results['from_name'] = \
NotifyMailgun.unquote(results['qsd']['name'])
if 'region' in results['qsd'] and len(results['qsd']['region']):
# Extract from name to associate with from address
results['region_name'] = \

View File

@ -107,6 +107,12 @@ apprise_url_tests = (
'a' * 32, 'b' * 8, 'c' * 8), {
'instance': NotifyMailgun,
}),
# We can use the `from=` directive as well:
('mailgun://user@localhost.localdomain/{}-{}-{}'
'?:from=Chris&:status=admin'.format(
'a' * 32, 'b' * 8, 'c' * 8), {
'instance': NotifyMailgun,
}),
# bcc and cc
('mailgun://user@localhost.localdomain/{}-{}-{}'
'?bcc=user@example.com&cc=user2@example.com'.format(