• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: File attachment link in the email [solved]

File attachment link in the email [solved] 17 years 4 months ago #1620

I got the file upload feature to work great but I want the email that sent out when the form is submitted to contain a link to the file the person uploaded. I tried putting the term {attachment} in the message body but it just returns the name of the file not an actual link.

Can this be done?

Does the file uploaded have to go to the uploads folder under the com_forme directory or can I specify another folder?

Thanks<br><br>Post edited by: webharvest, at: 2008/01/19 04:09
The administrator has disabled public write access.

Re:File attachment link in the email 17 years 3 months ago #1650

I figured out how to do it. Under the email tab put the following

{jos_siteurl}/components/com_forme/uploads/{attachment}

Highlight this text and click the link button in your html editor (in your backend). Put components/com_forme/uploads/{attachment} in the link field.

Thanks
The administrator has disabled public write access.

Re:File attachment link in the email 17 years 3 months ago #1652

  • jcsickz
  • jcsickz's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
It's not working for me. Can you explain that last link part a little more please?
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 17 years 3 months ago #1653

One thing you might want to try is making your link absolute rather than relative. I had to change a setting on my editor to always use absolute links. You do this by go to your mambots in the backend and find your editor mambot. Open it up and their should be a setting for relative or absolute. I hated to do it but I had to for my podcasting to work since podcasting doesn't support relative links.

Let me know if you don't understand anything I can try to elaborate more.

Thanks
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 17 years 3 months ago #1654

  • jcsickz
  • jcsickz's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
Ahh.. the word in {attachment} must match the field id of the upload field, in my case it was switching to {upload} that worked... well, almost. If there are any spaces in the filename, they gets translated into a + instead of a %20, which makes the url invalid. Anyone know why this is happening.

I must have been confused last night when I was working on this because I thought this was a way to actually attach the file to the e-mail. Does anyone know how to do that? This way is a good alternative, but I think actual attachment to the e-mail will be my best option.
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 17 years 3 months ago #1664

  • alex
  • alex's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 443
  • Thank you received: 3
Hi Guys,

here's what you should change to attach the files directly to the e-mail (it will be available in the next version also).

please edit the file: /components/com_forme/forme.php, and change this line
mosMail($form-&gt;emailfrom,$form-&gt;emailfromname,$to,$form-&gt;emailsubject,$form-&gt;email,$form-&gt;emailmode);

to
mosMail($form-&gt;emailfrom,$form-&gt;emailfromname,$to,$form-&gt;emailsubject,$form-&gt;email,$form-&gt;emailmode,null,null,$array_files);

Then, find
$params_field .= $field-&gt;name . '=' . $target_file .\&quot;||\n\&quot;;

and replace it with:
if(!isset($array_files)) $array_files = array();
$array_files[] = $mosConfig_absolute_path.'/components/com_forme/uploads/'.$target_file;
$params_field .= $field-&gt;name . '=' . $target_file .\&quot;||\n\&quot;;
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 17 years 3 months ago #1667

Cool, that is what I ultimately wanted but the link idea got the job done. I know this might be harder to do but what would be really cool is after the email is sent with the attachment the file in the upload folder gets deleted :)

By the way if I make this change do I just put a term in the email body that matches the upload name i.e. {attachment} or does it just attach it automatically?
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 17 years 3 months ago #1668

Cool, that is what I ultimately wanted but the link idea got the job done. I know this might be harder to do but what would be really cool is after the email is sent with the attachment the file in the upload folder gets deleted :)

By the way if I make this change do I just put a term in the email body that matches the upload name i.e. {attachment} or does it just attach it automatically?
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 17 years 3 months ago #1669

It should still work with the %20 thing that is just how it handles the spaces.
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 17 years 3 months ago #1672

  • alex
  • alex's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 443
  • Thank you received: 3
If you modified your script you don't need to add nothing. each time someone attaches a file to the form it will be attached to the email automatically.
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 17 years 3 months ago #1675

Have you verified this? I tried it and it didn't work. The file uploads and I get the email but no attachments. I sure I copied the code properly.

The only thing I have in the body of the email is {message} for the message that is filled out in the form.

Thanks
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 17 years 3 months ago #1679

  • alex
  • alex's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 443
  • Thank you received: 3
Hi,

please backup your forms using the Backup your forms button, and send the file to me at alex at rsjoomla dot com. Maybe i can spot something.
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 17 years 3 months ago #1722

Alex,
Did you ever determine anything from my form backup file?
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 17 years 3 months ago #1759

  • yevpak
  • yevpak's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Dear alex, please help, I did exactly what you wrote on this topic and I have no results...

thanks
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 17 years 3 months ago #1777

  • snoopy
  • snoopy's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Hi can you please help I can not find this file from the back end administrator. /components/com_forme/forme.php I can find the components/com_forme but I can not access forme.php. How I do I access the forme.php so that I can edit it.B)
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 17 years 3 months ago #1779

You have to use your ftp manager, download the file, edit it, then upload it again.

I believe you can also edit it from your cpanel on your server but that is much harder than using the ftp method.
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 17 years 3 months ago #1780

By the way Alex is currently looking at my setup to see why after making the changes outlined above it does not work. After he figures out why it isn't working on my setup hopefully we can post back here and help everyone.

I sent Alex my info yesterday.
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 17 years 3 months ago #1810

Alex fixed the problem. It was associated with the forme mambot. Uninstall the current mambot, then go to RSform > Support > Files in the backend and download the mambot from there and install it. Alex made some changes to it and it worked for me.

*Keep in mind this only works if you made the modes to the /components/com_forme/forme.php file that was discussed earlier*

We discovered it was the mambot causing the problem because the attachment mode worked if you used the form link provided in the component but it didn't work if you used the mambot to put the form in a content item.

**Oh yeah make sure you publish the mambot after installing the new one**

Thanks again Alex.
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 17 years 2 months ago #2179

Is the above coding solution for joomla 1.0.x only? I have the RSform for J1.5 and the only difference in the code to be changed was that \"mosMail\" in your code to be inserted is \"JUtility::sendMail\" but making these changes broke both the email and my file uploads (states that the file type is not allowed for all files).

Thanks!
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 17 years 2 months ago #2335

  • TonyBell
  • TonyBell's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Hi Alex - great product. Like others here I wanted to have the image eMailed to me and your patch to the forme.php file worked perfectly.

However, prior to applying the patch my CAPTCHA field worked, now however all I get where the CAPTCHA image should be is the good old red X - is it possible that the code change has had the effect?

Tony Bell
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 17 years 1 month ago #2520

  • dammit
  • dammit's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
In my forme.php I can't find the line of code that you have wrote to modify.
Why?? I've the last version of Rsform for Joomla 1.5
I hope that my English is good...I'm Italian.
Thank's
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 17 years 1 month ago #2701

  • sonome
  • sonome's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 6
The code to be changed is slightly different in the Joomla 1.5 version.

You need to change:
JUtility::«»sendMail($form-&gt;emailfrom,$form-&gt;emailfromname,$to,$form-&gt;emailsubject,$form-&gt;email,$form-&gt;emailmode);
to
JUtility::«»sendMail($form-&gt;emailfrom,$form-&gt;emailfromname,$to,$form-&gt;emailsubject,$form-&gt;email,$form-&gt;emailmode,null,null,$array_files);

And change:
$params_field .= $field-&gt;name . '=' . $target_file .\&quot;||\n\&quot;;
to
if(!isset($array_files)) $array_files = array();
$array_files[] = JPATH_SITE.'/components/com_forme/uploads/'.$target_file;
$params_field .= $field-&gt;name . '=' . $target_file .\&quot;||\n\&quot;;
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 16 years 11 months ago #3184

  • mark
  • mark's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Where is this code update in RSForm Pro or is something else necessary there?

Thanks
The administrator has disabled public write access.

Re:File attachment link in the email [solved] 16 years 11 months ago #3185

  • mark
  • mark's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
Where is this code update in RSForm Pro or is something else necessary there?

Thanks
The administrator has disabled public write access.

Re:File attachment (or link) in the email 14 years 4 months ago #12235

Dear RSjoomla,

I'm currently using RSform and I read here that it should be possible to send the uploaded file as an attachment in the confirmation-email. I've copy-pasted the code as described here, but it has no effect. The files are uploaded, but not sent by e-mail. Is there anything else I should do, besides changing the code in the file "forme.php"?

If sending the file as an attachment isn't possible, then I'd be satisfied with a link to the file in the e-mail, but then there is the problem with spaces in the filename, which cause the link to break.

I've tried this: http://www.rsjoomla.com/customer-support/forum.html#7571 and this: http://www.rsjoomla.com/customer-support/forum.html?limit=6&start=18#2701, but nothing worked.

I noticed that these posts were quite old. What's the solution for the current version of RSform?

Thanks and best regards,

David
Last Edit: 14 years 4 months ago by Davidovic. Reason: corrected post title
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!