Exemple #1
0
        async Task <AttachementForSend> ResolveAttachmentAsync(MessageAttachment att, MessageResolver resolver)
        {
            var ma = new AttachementForSend()
            {
                Name   = (await resolver.ResolveAsync(this, att.Name))?.Trim(),
                Mime   = (await resolver.ResolveAsync(this, att.Mime))?.Trim(),
                Stream = await resolver.ResolveStreamAsync(this, att.Data)
            };

            return(ma);
        }
Exemple #2
0
        async Task <AttachementForSend> ResolveReportAsync(MessageReport rep, MessageResolver resolver)
        {
            var repName = await resolver.ResolveAsync(this, rep.Name);

            if (repName == null)
            {
                repName = "report";
            }
            repName = Path.ChangeExtension(repName.Trim(), ".pdf");
            var ma = new AttachementForSend()
            {
                Name   = repName,
                Mime   = MimeTypes.Application.Pdf,
                Stream = await resolver.ResolveReportAsync(this, rep)
            };

            return(ma);
        }