Mastercard Interview Question

Technical Question: Given some sort of email sending interface and five inputs, write two functions that determines how many emails should be sent and deal with corner case to send out at least one email.