• Resolved Jan Boddez

    (@janboddez)


    There seems to be a bug that prevents multiple attachments from being sent. The same is true (I believe) with the main SIB plugin, but I’m posting it here because I’ve been able to work around it for this plugin.

    The issue happens because, in line 475 of woocommerce-sendinblue-newsletter-subscription/includes/wc-sendinblue.php, while processing multiple attachments, you’re using array_merge() with similarly structured associative arrays. Each new attachment’s name and content are thus essentially overwriting what was previously in $attachment_content.

    The solution, at least for this plugin, would be to make it a properly nested array instead. I’ve found the following changes do the trick:

    Line 475 in the already mentioned file:

    // $attachment_content = array_merge($attachment_content, $content);
    $attachment_content[] = $content;

    Line 519, same file:

    //$data["attachment"] = array($attachment_content);
    $data["attachment"] = $attachment_content; // $attachment_content is already two-dimensional
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Brevo

    (@neeraj_slit)

    Hello Jan,

    Thanks for reaching out today.

    I’d like to inform that we only allow single attachments to be included in email templates/campaigns.

    You’re able to read this on our documentation under “Advanced Options” here: https://help.sendinblue.com/hc/en-us/articles/209587285–Creating-an-email-campaign

    The reason for this is that it creates larger emails, which are not always supported by email systems. We only allow one attachment to limit the total size of the email since the maximum total size of your newsletter must be less than 5 MB.

    With that being said, your feedback and code suggestions have been forwarded to our technical team for future consideration.

    Hope this clarifies. Please let us know if you have any questions or concerns.

    Thread Starter Jan Boddez

    (@janboddez)

    Hmm. Okay. This isn’t an email campaign, though. These are transactional emails (WooCommerce invoices, in this case, plus a sort of manual that we’d like to be sent in the same email).

    Plugin Support Dulé

    (@lephenixdelafamille)

    Thank you @janboddez while this feature is in the works, perhaps conditional display based on transactional parameters could work.

    I’d recommend hosting documents on your website, cloud space like Google Drive, or DMS of your choice and share them as links with the recipients.

    I would like to reopen this case as I have also noticed this error.

    Also in the “mailin” plugin ( https://wordpress.org/support/plugin/mailin/reviews/ ) from SendInBlue for WordPress. In the documentation the email size is limited to 10MB but the use of attachments should and MUST be unrestricted for transactional sending of emails!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Allowing more than one attachment’ is closed to new replies.