panoramic icon indicating copy to clipboard operation
panoramic copied to clipboard

How to query templates table within mailer ?

Open dekhaus opened this issue 8 months ago • 1 comments

Hi

If I have multiple templates stored in my database - how can I perform a query in my mailer so that my mailer retrieves the template I want to use and uses that to generate the mail message ?

The documentation contains the following snippet ...

class MyEmail < ActionMailer::Base
  prepend_view_path TemplateStorage.resolver

but that doesn't give me the control that I need to retrieve the template my mailer needs to use based on supplied criteria

how can I modify the call above ( prepend_view_path TemplateStorage.resolver ) so that arguments are passed to the 'resolver' which can be used to query my templates table and only retrieve the needed template ?

Thanks Dave

dekhaus avatar May 30 '24 19:05 dekhaus