Automated e-mail that attaches an xml file


(Qz02) #1

Hi,

 

Not sure if this is possible but......

 

I'm looking for  a way to send an automated e-mail that attaches an xml file that already exists in our system. It's an xml built from our form submissions and obviously updates as a submission enters.

 

The client requires the xml file as an attachment so they can use this to integrate with their system.


(Nic Hubbard) #2

I don't think there is a way to do this. :(


(Ashish Karelia) #3

Hi,

 

Not sure if this is possible but......

 

I'm looking for  a way to send an automated e-mail that attaches an xml file that already exists in our system. It's an xml built from our form submissions and obviously updates as a submission enters.

 

The client requires the xml file as an attachment so they can use this to integrate with their system.

 

When you say the file exists on your system, did you mean it on server or it can be accessed via the Matrix admin interface i.e. is a file asset?

 

If its on server, then it can be easily done with bash script. If its on Matrix then have a look into 'Send email trigger action'. It won't send the file as attachment but Should be able to put the content of the XML file in the email body.

 

Also how often the email needs to be sent? Is it triggered by something or just happens at set frequency?

If the location of the XML (assetid) always gonna be the same?

 

Ash


(Qz02) #4

Hi Ashish,

 

Thank you for your reply.

 

The file does exist on Matrix. It just needs to be sent at a frequency time i.e every day or every week.


(Qz02) #5

I've got as far as creating a trigger that sends an e-mail with the xml in the body every time a new submission is created- that works fine and the client can use this but it maybe a pain to receive an e-mail each time the xml is updated. 

 

Anyone have any ideas on how i can get it to send let's say every 2 hours? Is there a way using the cron i wonder.


(Nic Hubbard) #6

I've got as far as creating a trigger that sends an e-mail with the xml in the body every time a new submission is created- that works fine and the client can use this but it maybe a pain to receive an e-mail each time the xml is updated. 

 

Anyone have any ideas on how i can get it to send let's say every 2 hours? Is there a way using the cron i wonder.

 

This would be pretty easy, but would need to be done outside of Matrix.

 

You would just write a simple script that gathers your XML from the appropriate URL, then emails it as an attachment. Then, you would just setup this script on the apache users cron (not the same as the cron inside Matrix) and have it run the script at a 2 hour interval.