Repository: mozmeao/snippets-service

Issue:
Update newsletter and s2d templates with new error_page_button_label variable
https://bugzilla.mozilla.org/show_bug.cgi?id=1510331

- [x]  After we push update to the snippets-server we want to update existing snippets with localized retry button text. 


Discussion:
/cc @mozmeao/lcm-team the new button bug and issue
Not happening for Fx64, added a note to check in #860
Thanks for working on this @jpetto !

We need to add the new field in the snippets-service side too. Is this something you'll take care or I can help with?
Ah, yep. I'll file a PR for that today.

Resolving patch:
diff --git a/snippets/base/admin/adminmodels.py b/snippets/base/admin/adminmodels.py
--- a/snippets/base/admin/adminmodels.py
+++ b/snippets/base/admin/adminmodels.py
@@ -335,7 +335,7 @@ class FxASignupTemplateInline(admin.StackedInline):
                 'utm_term',
                 'utm_campaign',
                 'block_button_text',
-                'do_not_autoblock'
+                'do_not_autoblock',
             ),
         })
     )
@@ -392,13 +392,14 @@ class NewsletterTemplateInline(admin.StackedInline):
                 'locale',
                 'success_text',
                 'error_text',
+                'retry_button_label',
             )
         }),
 
         ('Extra', {
             'fields': (
                 'block_button_text',
-                'do_not_autoblock'
+                'do_not_autoblock',
             ),
         })
     )
@@ -462,13 +463,14 @@ class SendToDeviceTemplateInline(admin.StackedInline):
                 'success_title',
                 'success_text',
                 'error_text',
+                'retry_button_label',
             )
         }),
 
         ('Extra', {
             'fields': (
                 'block_button_text',
-                'do_not_autoblock'
+                'do_not_autoblock',
             ),
         })
     )
diff --git a/snippets/base/migrations/0014_auto_20190916_1930.py b/snippets/base/migrations/0014_auto_20190916_1930.py
new file mode 100644
--- /dev/null
+++ b/snippets/base/migrations/0014_auto_20190916_1930.py
@@ -0,0 +1,23 @@
+# Generated by Django 2.2.4 on 2019-09-16 19:30
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('base', '0013_auto_20190916_0952'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='newslettertemplate',
+            name='retry_button_label',
+            field=models.CharField(default='Try again', help_text='Button label after a failed form submission', max_length=50, verbose_name='Retry Button Label'),
+        ),
+        migrations.AddField(
+            model_name='sendtodevicetemplate',
+            name='retry_button_label',
+            field=models.CharField(default='Try again', help_text='Button label after a failed form submission', max_length=50, verbose_name='Retry Button Label'),
+        ),
+    ]
diff --git a/snippets/base/models.py b/snippets/base/models.py
--- a/snippets/base/models.py
+++ b/snippets/base/models.py
@@ -1209,6 +1209,7 @@ def render(self):
             'utm_campaign': self.utm_campaign,
             'block_button_text': self.block_button_text,
             'do_not_autoblock': self.do_not_autoblock,
+            'retry_button_label': self.retry_button_label,
         }
         data = self._process_rendered_data(data)
         return data
@@ -1350,6 +1351,12 @@ class NewsletterTemplate(Template):
         verbose_name='Error Text',
         help_text='Text of error message if form submission fails.',
     )
+    retry_button_label = models.CharField(
+        verbose_name='Retry Button Label',
+        max_length=50,
+        default='Try again',
+        help_text='Button label after a failed form submission'
+    )
 
     ###
     # Extras
@@ -1395,6 +1402,7 @@ def render(self):
             'error_text': self.error_text,
             'block_button_text': self.block_button_text,
             'do_not_autoblock': self.do_not_autoblock,
+            'retry_button_label': self.retry_button_label,
         }
         data = self._process_rendered_data(data)
         return data
@@ -1566,6 +1574,12 @@ class SendToDeviceTemplate(Template):
         verbose_name='Error Text',
         help_text='Text of error message if form submission fails.',
     )
+    retry_button_label = models.CharField(
+        verbose_name='Retry Button Label',
+        max_length=50,
+        default='Try again',
+        help_text='Button label after a failed form submission'
+    )
 
     ###
     # Extras
@@ -1616,6 +1630,7 @@ def render(self):
             'error_text': self.error_text,
             'block_button_text': self.block_button_text,
             'do_not_autoblock': self.do_not_autoblock,
+            'retry_button_label': self.retry_button_label,
         }
         data = self._process_rendered_data(data)
         return data


Test patch: