Commit df44db71 authored by Romain Courteaud's avatar Romain Courteaud

Allow to configure the email message sent.

parent b006b7b8
......@@ -101,10 +101,11 @@ if (ticket is None) and int(person.Entity_statBalance()) > 0:\n
\n
ticket.reindexObject(activate_kw={\'tag\': tag})\n
\n
mail_message = ticket.RegularisationRequest_checkToSendUniqEvent(\n
portal.portal_preferences.getPreferredRegularisationRequestResource(),\n
\'Invoice payment requested\',\n
"""Dear user,\n
notification_message = context.getPortalObject().portal_notifications.getDocumentValue(\n
reference="slapos-crm.create.regularisation.request")\n
if notification_message is None:\n
subject = \'Invoice payment requested\'\n
body = """Dear user,\n
\n
A new invoice has been generated. \n
You can access it in your invoice section at %s.\n
......@@ -113,8 +114,17 @@ Do not hesitate to visit the web forum (http://community.slapos.org/forum) in ca
\n
Regards,\n
The slapos team\n
""" % portal.portal_preferences.getPreferredSlaposWebSiteUrl(),\n
\'Requested manual payment.\')\n
""" % portal.portal_preferences.getPreferredSlaposWebSiteUrl()\n
\n
else:\n
subject = notification_message.getTitle()\n
body = notification_message.convert(format=\'text\')[1]\n
\n
mail_message = ticket.RegularisationRequest_checkToSendUniqEvent(\n
portal.portal_preferences.getPreferredRegularisationRequestResource(),\n
subject,\n
body,\n
\'Requested manual payment.\')\n
\n
return ticket, mail_message\n
\n
......
......@@ -54,12 +54,10 @@
if REQUEST is not None:\n
raise Unauthorized\n
\n
return context.RegularisationRequest_checkToTriggerNextEscalationStep(\n
38,\n
\'service_module/slapos_crm_acknowledgement\',\n
\'service_module/slapos_crm_stop_reminder\',\n
\'Reminder: invoice payment requested\',\n
"""Dear user,\n
notification_message = context.getPortalObject().portal_notifications.getDocumentValue(reference="slapos-crm.acknowledgment.escalation")\n
if notification_message is None:\n
subject = \'Reminder: invoice payment requested\'\n
body = """Dear user,\n
\n
We would like to remind you the unpaid invoice you have on %s.\n
If no payment is done during the coming days, we will stop all your current instances to free some hardware resources.\n
......@@ -68,7 +66,18 @@ Do not hesitate to visit the web forum (http://community.slapos.org/forum) in ca
\n
Regards,\n
The slapos team\n
""" % context.getPortalObject().portal_preferences.getPreferredSlaposWebSiteUrl(),\n
""" % context.getPortalObject().portal_preferences.getPreferredSlaposWebSiteUrl()\n
\n
else:\n
subject = notification_message.getTitle()\n
body = notification_message.convert(format=\'text\')[1]\n
\n
return context.RegularisationRequest_checkToTriggerNextEscalationStep(\n
38,\n
\'service_module/slapos_crm_acknowledgement\',\n
\'service_module/slapos_crm_stop_reminder\',\n
subject,\n
body,\n
\'Stopping reminder.\',\n
)\n
</string> </value>
......
......@@ -54,12 +54,10 @@
if REQUEST is not None:\n
raise Unauthorized\n
\n
return context.RegularisationRequest_checkToTriggerNextEscalationStep(\n
2,\n
\'service_module/slapos_crm_delete_reminder\',\n
\'service_module/slapos_crm_delete_acknowledgement\',\n
\'Acknowledgment: instances deleted\',\n
"""Dear user,\n
notification_message = context.getPortalObject().portal_notifications.getDocumentValue(reference="slapos-crm.delete.reminder.escalation")\n
if notification_message is None:\n
subject = \'Acknowledgment: instances deleted\'\n
body = """Dear user,\n
\n
Despite our last reminder, you still have an unpaid invoice on %s.\n
We will now delete all your instances.\n
......@@ -68,7 +66,17 @@ Do not hesitate to visit the web forum (http://community.slapos.org/forum) in ca
\n
Regards,\n
The slapos team\n
""" % context.getPortalObject().portal_preferences.getPreferredSlaposWebSiteUrl(),\n
""" % context.getPortalObject().portal_preferences.getPreferredSlaposWebSiteUrl()\n
else:\n
subject = notification_message.getTitle()\n
body = notification_message.convert(format=\'text\')[1]\n
\n
return context.RegularisationRequest_checkToTriggerNextEscalationStep(\n
2,\n
\'service_module/slapos_crm_delete_reminder\',\n
\'service_module/slapos_crm_delete_acknowledgement\',\n
subject,\n
body,\n
\'Deleting acknowledgment.\',\n
)\n
</string> </value>
......
......@@ -54,12 +54,10 @@
if REQUEST is not None:\n
raise Unauthorized\n
\n
return context.RegularisationRequest_checkToTriggerNextEscalationStep(\n
13,\n
\'service_module/slapos_crm_stop_acknowledgement\',\n
\'service_module/slapos_crm_delete_reminder\',\n
\'Last reminder: invoice payment requested\',\n
"""Dear user,\n
notification_message = context.getPortalObject().portal_notifications.getDocumentValue(reference="slapos-crm.stop.acknowledgment.escalation")\n
if notification_message is None:\n
subject = \'Last reminder: invoice payment requested\'\n
body = """Dear user,\n
\n
We would like to remind you the unpaid invoice you have on %s.\n
If no payment is done during the coming days, we will delete all your instances.\n
......@@ -68,7 +66,17 @@ Do not hesitate to visit the web forum (http://community.slapos.org/forum) in ca
\n
Regards,\n
The slapos team\n
""" % context.getPortalObject().portal_preferences.getPreferredSlaposWebSiteUrl(),\n
""" % context.getPortalObject().portal_preferences.getPreferredSlaposWebSiteUrl()\n
else:\n
subject = notification_message.getTitle()\n
body = notification_message.convert(format=\'text\')[1]\n
\n
return context.RegularisationRequest_checkToTriggerNextEscalationStep(\n
13,\n
\'service_module/slapos_crm_stop_acknowledgement\',\n
\'service_module/slapos_crm_delete_reminder\',\n
subject,\n
body,\n
\'Deleting reminder.\',\n
)\n
</string> </value>
......
......@@ -54,12 +54,10 @@
if REQUEST is not None:\n
raise Unauthorized\n
\n
return context.RegularisationRequest_checkToTriggerNextEscalationStep(\n
7,\n
\'service_module/slapos_crm_stop_reminder\',\n
\'service_module/slapos_crm_stop_acknowledgement\',\n
\'Acknowledgment: instances stopped\',\n
"""Dear user,\n
notification_message = context.getPortalObject().portal_notifications.getDocumentValue(reference="slapos-crm.stop.reminder.escalation")\n
if notification_message is None:\n
subject = \'Acknowledgment: instances stopped\'\n
body = """Dear user,\n
\n
Despite our last reminder, you still have an unpaid invoice on %s.\n
We will now stop all your current instances to free some hardware resources.\n
......@@ -68,7 +66,17 @@ Do not hesitate to visit the web forum (http://community.slapos.org/forum) in ca
\n
Regards,\n
The slapos team\n
""" % context.getPortalObject().portal_preferences.getPreferredSlaposWebSiteUrl(),\n
""" % context.getPortalObject().portal_preferences.getPreferredSlaposWebSiteUrl()\n
else:\n
subject = notification_message.getTitle()\n
body = notification_message.convert(format=\'text\')[1]\n
\n
return context.RegularisationRequest_checkToTriggerNextEscalationStep(\n
7,\n
\'service_module/slapos_crm_stop_reminder\',\n
\'service_module/slapos_crm_stop_acknowledgement\',\n
subject,\n
body,\n
\'Stopping acknowledgment.\',\n
)\n
</string> </value>
......
19
\ No newline at end of file
20
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment