Example #1
0
        public MailMessageWrapper WithSubject(string subjectTemplate)
        {
            if (IsSubjectSet)
            {
                throw new InvalidOperationException("Subject has already been set");
            }

            var populatedSubject = TemplateParser.ReplaceTokens(subjectTemplate, TokenValues);

            ContainedMailMessage.Subject = populatedSubject;
            IsSubjectSet = true;
            return(this);
        }