5049

Send It, Prove It

Integrations
Medium
Pro
email
email-connector
attachments
streams
mocking

Send It, Prove It

Your customer wants order confirmations mailed out the moment an order is confirmed: a friendly HTML note to the buyer, the purchasing team on CC, and the confirmation PDF attached. Operations has one extra demand — proof. A dispatched confirmation must show up where every Business Central user looks for it, the Sent Emails list, and a failed one must not vanish: it has to sit in the Email Outbox, marked failed, with the reason attached. That rules out hand-rolled transport — you are wiring this into the email subsystem Business Central itself sends documents through.

Requirements

Create a codeunit named "Order Confirmation Mailer" with exactly this public procedure:

procedure SendConfirmation(AccountId: Guid; Connector: Enum "Email Connector"; ToRecipients: List of [Text]; CcRecipients: List of [Text]; OrderNo: Code[20]; CustomerName: Text; Document: InStream): Boolean

Composing the message

Each call composes exactly one email message:

  • The To recipients are exactly ToRecipients and the CC recipients are exactly CcRecipients, each list on its own address line — CC addresses must not leak into To or vice versa. The order in which the subsystem stores the addresses of a line is its own business and not graded. CcRecipients may be empty.
  • The subject is exactly Order <OrderNo> confirmed — for order SO-1042 that is Order SO-1042 confirmed.
The rest of the statement and 3 hints Unlock with Pro
ALBusiness Central 28.5
Pro
Pro problem

Solve it with Pro

You’re reading the opening of the statement. Pro unlocks the whole problem:

  • The full statement
  • Starter code in the browser editor
  • 10 grading tests, run on Business Central 28.5
  • 3 hints
  • The reference solution

Pro also opens all 92 Pro problems and lifts the daily limits on compile checks and submissions.

$10 / month
or $100 / year
Upgrade
This problem is part of Pro
Pro unlocks the full statement, tests, hints and solution. The code editor works on a computer.
Upgrade