Coder Social home page Coder Social logo

Comments (4)

JuanLeadSupply avatar JuanLeadSupply commented on July 17, 2024

It should work.

I tested this feature around one month ago with the version 6.0.0 of this library and it worked for me.

You have to be sure that file extension is allowed:
https://developers.sendinblue.com/v3.0/reference#sendtemplate

and also you should to encode the file, like in the following example code:

            $content = chunk_split(base64_encode(file_get_contents($filepath)));
            $attachment[] = new SendSmtpEmailAttachment(['content' => $content, 'name' => $filename]);
            $mailer->setAttachment($attachment);

from apiv3-php-library.

karsten-eger avatar karsten-eger commented on July 17, 2024

hm, interesting! It's even in the documentation:
see attachment
( Ignored if 'templateId' is passed )
https://github.com/sendinblue/APIv3-php-library/blob/master/docs/Model/SendSmtpEmail.md

from apiv3-php-library.

JuanLeadSupply avatar JuanLeadSupply commented on July 17, 2024

Karsten, you are right, the attachments doesn't with templates

I have tested a few minutes ago with my own library and it doesn't work, however I implemented the functionality for attachments (Maybe in the future...).

from apiv3-php-library.

rajatsib avatar rajatsib commented on July 17, 2024

Hi @karsten-eger @JuanLeadSupply

If templateId is passed and is in New Template Language format then both attachment url and content are accepted. If template is in Old template Language format, then attachment is ignored

See here

from apiv3-php-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.