Forums

Attach generated file to email

gaze 02 Apr, 2009
Hi There,

I have the following question,
I have a form with a couple of input fields and i want to add a server-generated file as attachement to the form email.
The file gets properly generated but i have no clue on how to attach it to the email.

Is this in possible within chronoforms?

Kind regards,
Johan van Leur
GreyHead 02 Apr, 2009
Hi Johan,

The email sender looks for an array called $attachments - add the path of your file to this array and it should be sent OK.In OnSubmit Before:
<?php
$attachments[] = "some/path/or/other";
?>

Bob
gaze 02 Apr, 2009
Hi,

I found it. and it works.

I have another question about that.
My form sends 2 email messages. 1 to the user (with limited information) the other to the admin (with much more information)
Is it possible to send the first mail without attachment and the 2nd one with attachment?
or is there some other callback function between the different email messages that i can (ab)use?

Kind regards,
Johan van Leur
GreyHead 02 Apr, 2009
Hi Johan,

I think - can't check right now - that there's only one attachment array in the current release. But this did come up recently and Max has talked about changing it - possibly in the next release. I know that he's re-factoring a lot of the code to aid flexibility like this.

Bob
Max_admin 03 Apr, 2009
Hi Johan,

in V3.1 RC3 there is an option in the Email properties to disable/enable attachments per email! in RC4 chronoforms is going to have an API which will give you more control, but for this feature, its already there in RC3 only right now!

Cheers,
Max

P.S: I suggest you wait for RC4
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
deaddy64 06 May, 2009

Hi Johan,

The email sender looks for an array called $attachments - add the path of your file to this array and it should be sent OK.In OnSubmit Before:

<?php
$attachments[] = "some/path/or/other";
?>

Bob



In RC5 I tried it and it's not work 😟 . Is there any changes in this version?
GreyHead 06 May, 2009
Hi Johan,

Yes it has changed, Max has just posted abotu attachements in another thread (in the last hour or so). I think that the code you need is there.

Bob
This topic is locked and no more replies can be posted.