• Fabrik V4.4.1 is now available.

    This version corrects the Admin issue introduced by V4.4. V4.4.1 is available through the Joomla Updater or for download through your My Downloads area of our website.

    Turns out a code change intended for our 5.0dev branch inadvertantly got pushed to the 4.x branch (by me, duh!). The javascript structure in 5.0 will change considerably and part of that change took effect with the inadvertant code change.

    We have reverted the code change and released 4.4.1. V4.4 has been retracted.

    Sorry for any inconvenience.

  • A new version of Full Calendar is now available.

    See the details here

Fixed File attached in an email

Status
Not open for further replies.

gilb33

New Member
Good morning,
I am in Fabrik4 joomla 5, and I have a form which has its validation with two plugins sending two emails, one to the member and the other to the treasurer of the association.
In the first email, a file is attached:

//email information reservation accepted
//Definition of attached file
$file = array();
$file [0] = $_SERVER['DOCUMENT_ROOT'].'images/mcbm/documents/recepisse/'.$this->data['mcbm_adherents___recepisse'];
return $file;

It works very well...

But in the second mail plugin, this same file is attached while there is no definition in the attachment evaluation.
I tried without success to put
$file = array();
$file[0] =' ' ;
return $file;
I still have the file attached to the email....
If you have a solution, thank you.
Sincerely
Gilbert
 
Good morning
Thank you Wezetel for your response.
I tried changing the variable name, the result is the same.
I also tried changing the file name:
$file = array();
$file[0] = $_SERVER['DOCUMENT_ROOT'].'/images/tactac/RIB.pdf';
return $file;
And I obtain two files attached in the message, that of the first email and the RIB of the second email.
You should try to reverse the order in the list of plugins....
Obviously Fabrik keeps a file sent to all the plugins that follow.
Sincerely
 
Where exactly are you doing this? In a form/list email plugin? Can you share more of the code please?
 
Good morning,
Thank you Achartier for your response.
It's in a form where I have two email plug-ins that follow each other.
In the first, I define an attached file:
$file = array();
$file [0] = $_SERVER['DOCUMENT_ROOT'].'images/mcbm/documents/recepisse/'.$this->data['mcbm_adherents___recepisse'];
return $file;
In the second I do not specify an attached file and I still have the same attached file in the email.
Sincerely
 

Attachments

  • Capture d’écran du 2024-02-04 18-04-54.png
    Capture d’écran du 2024-02-04 18-04-54.png
    59.6 KB · Views: 146
  • Capture d’écran du 2024-02-04 18-05-17.png
    Capture d’écran du 2024-02-04 18-05-17.png
    49.9 KB · Views: 145
Add
$this->attachments = [];
in plugins\fabrik_form\email\email.php line 87 to reset the attatchments in case of multiple email plugins.
 
Good morning,
Many thanks to Troester and all of you for your help.
I just did a test and it works!
Sincerely
 
Status
Not open for further replies.
Back
Top