Send Email error

Hi team,
I have some issues with sending my work period report email

Capture

Basically i am able to configure the email sending action and the rule,but the problems is i keep getting this attached error

snip1


You need to break apart the save report and email action into seperate rules using execute automation command action.
It is as the message says that the file is in use. Ie.samba is sending before the file has had chance to finish saving.
Move your sending actions to automation command executed rule and put a execute automation command action in the wp close rule to trigger the sending rule with say a 1s delay to give time for report to generate and save before trying to send.

1 Like

Hi JTRTech
Thankyou for your insights, kindly illustrate what you mean, i will really appreciate.

I have understand what is happening an email is being sent before saving action is completed.That is the reason am getting a static work-period report email rather that the report that coincide with that specific day.
I have understood what JTRTech is saying ,that i have to separate Save Report Action with Send email Action with two different Rules.
Kindly show how these rules are supposed to be constituted,i will really appreciate

Capture2

No, the other way round.
You save the report in the work period ended rule.
Then have a execute automation command action to trigger the emailing rule like a ‘virtual button press’.
Execute automation command action has a delay field so you can delay emailing by say 1 seccond to allow report to be saved properly first.

4513718ca56b1ad2b2d0d2db8a37979e1b00b852_2_690x386

For next update I added Command Name and Command Value parameters to Save Report to File action so it can execute the command after report gets saved.

This is what i found in one of emres tutorial,i have updated the command name and command value,so that the system will not send email before the file is created.
I will have to wait up-to tomorrow to ascertain whether this is true since i dont want to close my work period at this hour

Hello @muthoga,

You can try to apply steps of below document;

https://kb.sambapos.com/en/2-4-12-e-how-to-send-reports-as-email-at-end-of-work-period/

Hello Nizam
This is the tutorial that i have used in the setup,my only problem is that the system sends the email before saving of the latest work-period ends.That means that you will not get the latest email,i guess JTRtech understand that and that was what he was trying to illustrate however i did not understand him fully, he need to illustrate using diagrams

@nizam that tutorial needs updated it shows old action and does not include the new feature Emre created to ensure report is created first before it tries to send it. People following it will run into the same issue if their report is large.

I just want to know how to separate save message in a file action from sending email action.The system is trying send the email before the action has fully saved the report

Capture

The method Emre mentioned is correct. But it looks like you have that file open somewhere.

But you need to build it correctly. Show me your rule again. The send email action needs to be in a separate rule.

The first rule would contain your Save to file action as Emre demonstrated. THen you need another Automation Command Executed rule with the Automation Command Equals Send Email constraint and then put your send email action in there and use [:File] for the file location and [:Email] email value in the action.

Your Send Email action would look like:

Your Save to file action would look like:

Your First Rule:

Your final rule:

2 Likes

This is really what i want @kendash,let me try what you have done in case i hit some snag,will let you know.
Regards

kindly advise,i have done this as per your illustration and its working fine.The only problem is that i have received 116 emails.The work period report has been sent to me like 116 times,kindly let me know how to stop this

You didn’t follow what I said.