There are a few issues that are all related to questions about how to use the available eMail merge features in forena (document type eMail). This issue will be used to track the progress about extending the available documentation regarding this topic. A parent link to this issue will be added in the issues containing questions about the eMail features.

Comments

Pierre.Vriens’s picture

OK, I'm trying to get started with that sample eMail rpt ... What isn't clear to me about using it is this: when I have the rendered report in front of me, what else do I need to do to actually SEND the corresponding eMails? Like what is the equivalent of a SEND button in an eMail client when I finish writing an email? Maybe just click the link corresponding to the eMail document format? If that's what needed, wouldn't it be more intuitive to rephrase the label of that link to something like "Send eMails Now"

Transmitter’s picture

I'd be interested to automate it.
Is there a possibility to send a report every night automatically via mail to myself?
Rule are already active, but so far I couldn't get Rules to work closely together with Forena.

metzlerd’s picture

There is not currently any possiblity to send emails via cron jobs or anything light that. I'd be willing to entertain rules integration if I can figure out how or if someone else would be willing to consider a patch.

Yes clicking on the email link is the way to get the emails to send. The Active Users Email report is done as an example. Usually links to this document type are created in other reports which express summary data for the emails being sent instead of the data so in my own applications the link isn't used much.

I will try and explain this soon in a video series which I've been meaning to get to, but it won't likely happen until next year.

metzlerd’s picture

FYI: There has been some progress on this front to get rules to send email on node updates when items are imported with feeds at #2398251: How to store a report into a node?

Pierre.Vriens’s picture

David, I also noticed that interesting #2398251-4: How to store a report into a node? comment, and now wonder where in the docu to best add some type of chapter titled something like "Cookbook", "Ideabook", or something similar. Probably the existing docu about using the "Bean" module belongs in the same area. Suggestions on that?

Pierre.Vriens’s picture

Something in How to send the views record in an email to admin at regular time interval of 8 hours? reminded me about this Forena issue.

That question there includes a Rule (created with the Rules module), which looks like so (ignore the error in the "to" field for now):

    { "rules_send_emails_to_fuel_company_approved_client_list" : {
        "LABEL" : "Send emails to fuel company approved client list",
        "PLUGIN" : "reaction rule",
        "OWNER" : "rules",
        "REQUIRES" : [ "php", "mimemail", "rules_onceperday" ],
        "ON" : { "once_per_day" : [] },
        "DO" : [
          { "mimemail" : {
              "key" : "somebody@example.com",
              "to" : "ok",
              "subject" : "ok",
              "body" : "\u003C?php\r\n$view = views_get_view(\u0027calling_agent_summary\u0027);\r\nprint $view-\u003Epreview(\u0027default\u0027);\r\n?\u003E",
              "language" : [ "" ]
            }
          }
        ]
      }
    }

It uses (depends on) modules "mimemail" and "rules_onceperday" to send an eMail once a day.

The body of that eMail consists of some (basic) PHP code, to actually print the results of some view.

What I now wonder about in the context of Forena are these questions/thoughts:

  1. What should the 'body' content of the above rule be replaced with to "include" a specific Forena report (which doesn't use Forena's own 'eMail' document format ... yet)?
  2. Is it possible to remove that MimeMail dependency somehow, and replace it by Forena's own 'eMail' document format?

PS: let me know if I should create a separated Forena support issue for this.

metzlerd’s picture

Actually I'm glad you brought this up. There actually has been some other progress on this front. We are currently using forena to send emails from a cron job via a drush command. Here is an example of the drush command:

drush -u 1 frx myemailreport.email

This functionality is already in the current release.

Also a reminder that you can always use the "Embed Forena Reports" input filter if you have your input filter system configured properly:

[report:sample.states]

when embedded in any contenat using text formats configured to use "Embed Forena Reports" filter can embed report content via email.