@@ -185,8 +185,10 @@ def send_email_to_provider(notification):
185185 recipient = recipient .decode ("utf-8" )
186186 personalisation = redis_store .get (f"email-personalisation-{ notification .id } " )
187187 if personalisation :
188- personalisation = personalisation .decode ("utf-8" )
189- notification .personalisation = json .loads (personalisation )
188+ p = personalisation .decode ("utf-8" )
189+
190+ p = json .loads (p )
191+ notification .personalisation = p
190192
191193 service = SerialisedService .from_id (notification .service_id )
192194 if not service .active :
@@ -210,6 +212,12 @@ def send_email_to_provider(notification):
210212 template_dict , values = notification .personalisation
211213 )
212214
215+ html_email = str (html_email )
216+ html_email = html_email .replace ("%5B" , "" )
217+ html_email = html_email .replace ("%5D" , "" )
218+ html_email = html_email .replace ("(" , "" )
219+ html_email = html_email .replace (")" , "" )
220+
213221 if notification .key_type == KeyType .TEST :
214222 notification .reference = str (create_uuid ())
215223 update_notification_to_sending (notification , provider )
@@ -225,7 +233,7 @@ def send_email_to_provider(notification):
225233 recipient ,
226234 plain_text_email .subject ,
227235 body = str (plain_text_email ),
228- html_body = str ( html_email ) ,
236+ html_body = html_email ,
229237 reply_to_address = notification .reply_to_text ,
230238 )
231239 notification .reference = reference
0 commit comments