Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Had to use substantially different config to get this bundle working. #43

Open
henrypenny opened this issue Jun 1, 2017 · 2 comments
Open

Comments

@henrypenny
Copy link

Here's the config I needed to get this working:

Using Guzzle5 adaptor.

swiftmailer:
    transport: %mailer_transport%
    spool:     { type: memory }

cspoo_swiftmailer_mailgun:
    key: "%mailer_mailgun_key%"
    domain: "%mailer_mailgun_domain%"

services:
    mailgun.library:
        class: Mailgun\Mailgun
        public: true
        arguments: ["%mailer_mailgun_key%", '@guzzle5.adpater']
        calls:
          - ['setApiVersion', ['v3']]

    guzzle5.adpater:
        class: 'Http\Adapter\Guzzle5\Client'
        arguments: ['@guzzle5.client']

    guzzle5.client:
        class: GuzzleHttp\Client
        arguments: [{'base_url':'https://api.mailgun.net', {'defaults' : {'auth' : ['api', '%mailer_mailgun_key%']}}}]

This is quite different to the docs, so I'm wondering where I went wrong.

@Nyholm
Copy link
Collaborator

Nyholm commented Jun 1, 2017

What version are you running?

You should not be required to configure the guzzle client like that.

@henrypenny
Copy link
Author

henrypenny commented Jun 1, 2017

From composer.lock:


            "name": "cspoo/swiftmailer-mailgun-bundle",
            "version": "0.3.1",
...
            "name": "mailgun/mailgun-php",
            "version": "v2.3.2",
...
            "name": "php-http/guzzle5-adapter",
            "version": "v1.0.0",

I have had swiftmailer-mailgun-bundle working for several years. I recently had to upgrade from symfony 2.7 to 2.8 and that's when everything stopped working.

Previously I had in my lockfile:

            "name": "cspoo/swiftmailer-mailgun-bundle",
            "version": "dev-master",
...
            "name": "mailgun/mailgun-php",
            "version": "v1.8",

No php-http or guzzle adapters.

It definitely didn't work with the setup in your docs. I have no idea if there's something else weird in my codebase though.

I also noticed that different client providers seemed to require different mailer_mailgun_domain formats.

Sometimes:

    mailer_mailgun_domain: 'acme.com'

Sometimes:

    mailer_mailgun_domain: 'https://api.mailgun.com/v3/acme.com'

I'm not sure about that - I'm using the 'acme.com' form right now.

Unfortunately I have no more time to investigate this further, but I'm posting this in the hope it is of some use to you or helps someone else in a bind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants