Sending automatic email per week about few records

Hello everyone,

We want to create a functionality such that when we have update on the few fields in the inventory module and it should send an email particular set of users on the weekly basis.

In the email, we want to send an table with details like name, dept, present_count, future_count, etc. for the multiple records. We have these info in the inventory module.

How can we achieve it?

Using v7.13 and we are thinking to use email template, workflow & scheduler.

Thanks in advance!

Not easy. First problem is workflow will run on a date or relative day but not every 7 days. So you’ll have to create within the workflow some kind of “date last sent” and then logic that updates it to “today” when sent and then triggers when date last sent is equal to today - 7 days.

The variables are going to be tricky. Unless the variables come from the record you are sending to (I’m guessing not) you’re not going to be able to pull the “count” for example if that data comes from a product.

Your options are build your own email and scheduler via code, which is pretty straightforward, or I think maybe @pgr 's plugin might work to help you get the variables in the email template to allow you to use workflow and email templates.

1 Like

Thank you! Is there any other way to do it :melting_face: :thinking: Like create an report on the CRM and email it to users.

I agree with Paul that your options will be limited. Have a look at the Scheduled Reports, though.

On the dev, I had a below error when I try with scheduled reports.

log call at: modules/EmailMan/tpls/config.tpl:473 - styleChecked is not set

Check cron is working and scheduler is actually succeeding in it’s scheduled tasks. I’ve seen that emailman error before.

Are you only wanting the item lines that have been amended to be shown on the report or an entire stock list as it were sent on schedule?

1 Like

I check last run field on the scheduled reports but I don’t have any datetime there. Also, I did not receive an email with this report.

I have few fields in this module holding name & numbers. So, in the suitecrm report I am making report like a table with this data. Now, I just want to email this same table to few users every week. I hope I am able to explain you what we are trying to do.

That should be the report generation schedule tasks page - you should see them all flowing like that.

I’ve had trouble with cron before with having to specify the cli version of php within the crontab file itself - using the installer crontab suggestion didn’t quite work for me, when i get home i’ll dig these examples out to share with you and i’ll have a look to see if i’ve done anything similar to what your trying to achieve and share that with you.

1 Like

Just as an FYI, I use scheduled reports all the time. So far they have worked flawlessly. So I think you can rule out a bug.

Can you show us a screen shot of your email scheduler and how you’ve set it up?

I am trying like this

In the report’s subpanel, I have something like below.

Just for testing, try and enter the email address in directly like this:

Still it did not work. I guess I am doing something wrong. I will try on another instance and update you.

I saw the below error in the log while testing it.

Scheduler got both a job_url and job_function

Do you have any schedular to run aor schedular reports? If yes, how do you configure it?

1 Like

Did you select URL as Job and gave scheduled report’s entire URL?

Edit: I found run Scheduled Reports job in that dropdown

Thank you so much :heavy_heart_exclamation: :smiley: :smiley:

one question @pstevens

If we create another report with scheduled report in the subpanel. Do we need to create new schedular for it?

Yes each report has to have is own scheduler

@pstevens, Little confused. Do we need to define Job URL too?

Under job: we are selecting Run Scheduled reports. So we if want to send two different scheduled reports at same time then we can just use one schedular?