notify_data body notification text icon notification image url if noti

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
notify_data = {
'body': notification.text,
'icon': notification.image.url if notification.image else None,
'requireInteraction': True,
'actions': [
{'action': str(i), 'title': title} for i, title in enumerate(notification.actions_text)
],
'data': {
'url': make_url(subscriber, notification.url),
'actionUrls': [
make_url(subscriber, url)
for url in notification.actions_url
],
'id': id,
'title': notification.title,
'notifyUrl': settings.SITE_URL + '/notify?domain=' + str(notification.domain.signed_id) + '&name=' + notification.domain.full_name,
}
}