diff --git a/app/main/views/send.py b/app/main/views/send.py index 560c5cb3a..6ef2afc77 100644 --- a/app/main/views/send.py +++ b/app/main/views/send.py @@ -1,4 +1,3 @@ -import itertools import time import uuid from string import ascii_uppercase @@ -517,19 +516,27 @@ def _check_messages(service_id, template_id, upload_id, preview_row): current_service, show_recipient=False, ) + + allow_list = [] + if current_service.trial_mode: + # Adding the simulated numbers to allow list + # so they can be sent in trial mode + for user in Users(service_id): + allow_list.extend([user.name, user.mobile_number, user.email_address]) + # Failed sms number + allow_list.extend(["simulated user (fail)", "+14254147167", "simulated@simulated.gov"]) + # Success sms number + allow_list.extend( + ["simulated user (success)", "+14254147755", "simulatedtwo@simulated.gov"] + ) + else: + allow_list = None recipients = RecipientCSV( contents, template=template or simplifed_template, max_initial_rows_shown=50, max_errors_shown=50, - guestlist=( - itertools.chain.from_iterable( - [user.name, user.mobile_number, user.email_address] - for user in Users(service_id) - ) - if current_service.trial_mode - else None - ), + guestlist=allow_list, remaining_messages=remaining_messages, allow_international_sms=current_service.has_permission("international_sms"), )