I am using App Engine Modules in my python project. (https://developers.google.com/appengine/docs/python/modules/#Python_Background_threads)
I am also receiving email in m project: https://developers.google.com/appengine/docs/python/mail/receivingmail
I want to direct the emails to my worker module and not the default module. To that end my worker.yaml has the following settings
worker.yaml
api_version: 1
application: integrate
module: worker
version: 1-0-0
runtime: python27
threadsafe: true
inbound_services:
- mail
builtins:
- deferred: on
handlers:
- url: /admin/.+
script: src.worker.main.app
login: admin
- url: /_ah/mail/.+
script: src.worker.main.app
login: admin
- url: /.*
script: src.worker.main.app
app.yaml
api_version: 1
application: integrate
version: 1-0-0
runtime: python27
threadsafe: true
builtins:
- deferred: on
handlers:
- url: /admin/.+
script: src.default.main.app
login: admin
- url: /.*
script: src.default.main.app
I even tried adding a dispatch.yaml
application: integrate
dispatch:
- url: "*/_ah/mail/.+"
module: worker
But no matter what I do the emails which reach my app are handled by the default module. Any idea what I am missing here? I see the emails coming in but no matter what I do they only go to the default module.
The mail API provides two ways to send an email message: the mail. send_mail() function and the EmailMessage class. This page describes how to use the legacy bundled services and APIs. This API can only run in first-generation runtimes in the App Engine standard environment.
Find, diagnose, and fix complex issues. Python on Google Cloud integrates with Cloud Monitoring, Cloud Trace, Cloud Logging, and Error Reporting, allowing you to transparently instrument live production applications to rapidly diagnose performance bottlenecks and software bugs.
Inbound services could be used only within default module and that is expected behavior. The fact that it works for you locally in devserver is a bug, actually.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With