feat(notification): add custom message

This commit is contained in:
Hivert Quentin
2023-08-30 17:04:49 +02:00
parent acaddf5d4f
commit 6b647050fc
5 changed files with 21 additions and 3 deletions
+4 -1
View File
@@ -1220,6 +1220,7 @@ static NSString *sieveScriptName = @"sogo";
{
// BOOL alwaysSend;
NSString *notify;
NSString *message;
id addresses;
int i;
@@ -1232,12 +1233,14 @@ static NSString *sieveScriptName = @"sogo";
if ([addresses isKindOfClass: [NSString class]])
addresses = [addresses componentsSeparatedByString: @","];
message = [values objectForKey: @"notificationMessage"];
for (i = 0; i < [addresses count]; i++)
{
v = [addresses objectAtIndex: i];
if (v && [v length] > 0)
{
notify = [NSString stringWithFormat: @"notify \"mailto:%@\";\r\n", v];
notify = [NSString stringWithFormat: @"notify :message \"%@\"\r\n \"mailto:%@\";\r\n", message, v];
// if (alwaysSend)
// [script insertString: notify atIndex: 0];
@@ -82,6 +82,8 @@
/* notification */
"Notify incoming messsages" = "Notify incoming messsages";
"Notification Message Sent" = "Notification message sent";
"Notification Message" = "Notification of new message on %{0}";
/* d & t */
"Time Zone" = "Time Zone";
@@ -82,6 +82,8 @@
/* notify messages */
"Notify incoming messsages" = "Notifier les messages entrants";
"Notification Message Sent" = "Message de notification envoyé";
"Notification Message" = "Nouveau message reçu sur %{0}";
/* d & t */
"Time Zone" = "Fuseau horaire";
+10 -1
View File
@@ -1437,11 +1437,20 @@
</md-autocomplete>
</md-chips>
</md-input-container>
<md-input-container class="md-block md-flex md-input-has-placeholder">
<label><var:string label:value="Notification Message Sent"/></label>
<textarea name="notificationMessage"
id="notificationMessage"
ng-model="app.preferences.defaults.Notification.notificationMessage"
ng-required="app.preferences.defaults.Notification.enabled == 1">
</textarea>
</md-input-container>
</div>
</div>
</md-tab>
</var:if>
<!-- END OF MAIL > FORWARD -->
<!-- END OF MAIL > NOTIFICATIONS -->
</md-tabs>
</var:if>
@@ -20,6 +20,8 @@
this.autocomplete = {forward: [], notification: []};
this.mailLabelKeyRE = new RegExp(/^(?!^_\$)[^(){} %*\"\\\\]*?$/);
this.emailSeparatorKeys = Preferences.defaults.emailSeparatorKeys;
if (!Preferences.defaults.Notification.notificationMessage)
this.preferences.defaults.Notification.notificationMessage = l('Notification Message', $window.defaultEmailAddresses);
if (Preferences.defaults.SOGoMailAutoMarkAsReadMode == 'delay')
this.mailAutoMarkAsReadDelay = Math.max(1, this.preferences.defaults.SOGoMailAutoMarkAsReadDelay);
else
@@ -724,7 +726,7 @@
});
}
else {
recipient = contact.$shortFormat();
recipient = contact.$$email;
}
if (recipient)