I’m trying to set up the Uniform plugin with Mailgun as the external service. Although configuring Mailgun doesn’t seem to work. In my config.php I added the following lines.
But none of them seems to have some effect. References to the Uniform plugin docs on this forum are outdated. Also the uniform, docs states something about creating a plugin with email settings, but I can’t find an example of the structure. Can anyone help me out?
Thanks, that makes sense. Just tried to configure the service that way but without luck. Still getting the “The email could not be sent” message. I tried debugging from the Kirby source and from the plugin source, but that didn’t tell me a lot. Also, I’m running PHP’s built-in server so all error info is displayed in the terminal and there is none.
The forum post is this one (second link):
Which works but once you get to the docs you’ll have to search again for the right topic.
Would be great to be able to define those things in the config rather that at the action, and have the plugin listend to the global config. Those things are generally application-wide.
The Mailgun service requires the domain option, too, did you specify that?
There is nothing I can do about the link to the docs. Although the GitHub wiki now links to the documentation at Read the Docs, the content is exactly the same and you can still find the documentation on the service and service-options action options there. The link points to the documentation of Uniform v2.3, though, and you are using v3 (but the email action options are the same in this case).
@texnixe
I found it through a Google search I suppose, looking for Kirby email configuration.
@mzur
Yes, I tried domain, host and hostname, all without luck. My main issue now is the rather ambiguous error message (The email could not be sent). Any pointers as to why would be very welcome and make it a lot easier to debug. Or even an exception telling me where the error originated. I already tried locating the message using a text search throughout the code to debug it in the source, but nothing there either. I’ll have to dig a little deeper I guess.
This is the line of code you are looking for (in kirby/vendor/getkirby/toolkit/lib/email.php). You can try and debug the content of the response object.
@mzur
Thanks, found that already, though
In the end, I decided to write something small myself because I have the required code available in other projects.
Is email configuration in the config.php indeed deprecated?
If not, how can I configure mailgun globally, so I don’t need to provide the API key and domain every time I send an email?
Write something yourself to replace the email service or to replace Uniform? I’m asking because I want to eliminate all possible bugs in Uniform v3 beta.
Finally found it! Sending emails from localhost using Mailgun is blocked because a valid SSL certificate is required. On the production server with an SSL certificate, it works as expected. There is probably a workaround to use it without the certificate, but for me, it’s ok if it works in production.