File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,7 +44,13 @@ def perform(
4444 personalisation . parent &.email
4545 end
4646
47- return if email_address . nil?
47+ if email_address . nil?
48+ Rails . logger . warn (
49+ "Failed to find email address for template #{ template_name_sym } , " \
50+ "parent #{ personalisation . parent &.id } "
51+ )
52+ return
53+ end
4854
4955 template = NotifyTemplate . find ( template_name_sym , channel : :email )
5056 raise UnknownTemplate if template . nil?
Original file line number Diff line number Diff line change 165165 expect ( notifications_client ) . not_to receive ( :send_email )
166166 perform_now
167167 end
168+
169+ it "writes a warning to the logs" do
170+ expect ( Rails . logger ) . to receive ( :warn ) . with (
171+ /Failed to find email address for template #{ template_name } /
172+ )
173+ perform_now
174+ end
168175 end
169176
170177 context "with a consent form" do
You can’t perform that action at this time.
0 commit comments