attachments: (attachments || []).map(({ contentType, filename, content }) =>
            ({
              type: contentType,
              name: filename,
              data: (typeof content === 'string' ? Buffer.from(content) : content).toString('base64')