Skip to Content Skip to Menu

🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

SOLVED: Add current page URL in mail

  • tangelvy
  • tangelvy
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 0
9 years 6 months ago - 9 years 6 months ago #265643 by tangelvy
SOLVED: Add current page URL in mail was created by tangelvy
Hi,

Thanks for your work on this component, it's very practical !

Nevertheless, I miss a feature : I would like the current page URL (the page from which the message is send) to be displayed in the notification email rather than the livesite URL. This way, we could use UddeIM to alert specific administrators on a new article.

I dont have a good knowledge of php, and I'm struggling to get this working... would it be possible to give me a hand please?

Many thanks
Last edit: 9 years 6 months ago by tangelvy.

Please Log in or Create an account to join the conversation.

  • slabbi
  • slabbi
  • OFFLINE
  • Posts: 3709
  • Thanks: 250
  • Karma: 153
9 years 6 months ago #265648 by slabbi
Replied by slabbi on topic Add current page URL in mail
I can point you to the correct place:

includes.php line 809+
function uddeIMdispatchEMN($var_msgid, $item_id, $cryptmode, $var_fromid, $var_toid, $var_message, $emn_option, $config)
...
$var_body = str_replace("%livesite%", $pathtosite, $var_body);
etc.

uddeIM & uddePF Development
CB Language Workgroup
CB 3rd Party Developer
The following user(s) said Thank You: tangelvy

Please Log in or Create an account to join the conversation.

  • tangelvy
  • tangelvy
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 0
9 years 6 months ago #265669 by tangelvy
Replied by tangelvy on topic Add current page URL in mail
Thank you for the quick reply!

It was still a bit difficult to find how to do what I wanted with my poor php, but I succeded!

Here is the way to proceed for others who would like to do the same :

- Display uddeIM Component in a module or inside an article thanks to an extension like Include Component or Components Anywhere (with a menu item giving the compose message view)

- modify components/com_uddeim/includes.php line 811 :
Code:
$pathtosite = uddeIMgetPath('live_site');
becomes
Code:
$pathtosite = $url = htmlspecialchars($_SERVER['HTTP_REFERER']);

(Getting current page URL (JURI::current) doesnt work, because it gives index.php/component/uddeim/?task=save&Itemid=0, so this code gets the previous page URL.)

It's probably not the best solution, but it does the trick for me: users can write an article, then send it manually to the validators they choose (and not an automatical notifcation based on groups, like all what I found on the Joomla extension directory).
It would be great to add natively this feature in future releases (so as a module with the compose view...).

Please Log in or Create an account to join the conversation.

Moderators: beatnantslabbikrileon
Powered by Kunena Forum