Forum OpenACS Development: Get the notification message different

hi
can anybody please help me out how to modify changes in the from address for the automatic notifications

i want to modify
mailto:notification-2020-862@azri.biz
instead of this i shuld get

mailto:notification-DevelopmentProblems@azri.biz

where my 862 is the forum_id
2020 is my message_id

thanks
regards
vamshi

The below is sample message how i am gettin now
*******************************************************
mailto:notification-2020-862@azri.biz

To :
mailto:vkkaniganti@hotmail.com

Subject :
Checking what is comming

Date :
Mon, 03 Nov 2003 08:08:45 GMT

Reply  Reply All  Forward    Delete  Printer Friendly Version

Forum: Development Problems
Thread: Checking what is comming
Author: Vamshi Krishna Kaniganti (mailto:vkkaniganti@hotmail.com)

checking
*****************************************************

I wish we were adding at least one descriptive email header attribute e.g.:

X-OpenACS: $forum_name

or somesuch.

Thanks for replying

where shuld i use the $forum_name as the notifications are called automatically, i could not get from where it is called

i could not get your point , let me explain it properly
when u posted to this message i got a mail
from : mailto:notification-139776-2962@openacs.org

instead of this i want like
from : mailto:notification-OpenACSDevelopment-Forum@openacs.org

The link looks this way because it is intended to be replied to and associated automatically to the object it refers to, so that you can for example answer to a forum thread by email (an optional feature of forums that has to be set up deliberately).

I guess there is no UI place to change it, you have to dig in the notifications code.

Collapse
Posted by Raad Al-Rawi on

Hi Vamshi


You could implement a change to the notifications code in order to achieve what you want, by changing the reply_address proc in packages/notifications/tcl/notification-email-procs.tcl:

Amend the line:

return "[address_domain] mailer <[reply_address_prefix]-$object_id-$type_id@[address_domain]>"

to

return "[reply_address_prefix]-[acs_object_name $object_id]@[address_domain]>"

Don't forget that the notifications package parameters EmailDomain and EmailReplyAddressPrefix need to be set according to what you want.

I don't know if this can break due to a failure to find the object name, so I can't guarantee it will work sensibly in all cases but it might do the trick.

It would be good to expose/parameterise this in the UI somehow, in case people don't want to use the reply-by-email feature. Maybe another parameter ObjectNameInReplyAddress? Any volunteers? :)

HTH

 

<Raad>

Collapse
Posted by Vamshi Krishna Kaniganti on
thanks Raad
i have tried this method long back but could not get the solution so i have posted in the forums, please help me out doing i am doing some where wrong i could not get it

the mails are comming as i said before in my post,

This was the code i implemented to test it ,
**********************************************

  #adding the name to the object id instead of id
        db_0or1row  object {select acs_object.name(temp.context_id) as object_name from (select context_id from acs_objects where object_id = :object_id) temp }
sss
            return "[address_domain] mailer <[reply_address_prefix]-$object_name-$type_id@[address_domain]>"

Thanks
vamshi

Collapse
Posted by Raad Al-Rawi on
Vamshi

When you make changes to any .xql files, or to .tcl files that are under a package's TCL directory, the changes are not implemented instantly/dynamically by default.
You will need to either watch the file being changed (using the package manager), or restart your instance of OpenACS - it sounds like this could be why you are not seeing your changes.

Oh, you might like to use the [acs_object_name $object_id] method rather than executing the query - it should do the job properly and it's tidier code :)

<Raad>

Collapse
Posted by Vamshi Krishna Kaniganti on
Thanks Raad,
i have done everything as you said before but it was not working,  i am not able to trace out

when an messges is posted in the form if the particular user has the notifications , then some event or something shuld be called such that the message is inserted into the proper database,
so the notification-email-procs.tcl file their is an api
of send where it is called i am not able to get that one ,

thanks
vamshi

Collapse
Posted by Raad Al-Rawi on
Vamshi

I'm not sure I follow you exactly there!

Let's check one thing at a time - have you set the package manager to watch the notification-email-procs.tcl file?

<Raad>

Collapse
Posted by Vamshi Krishna Kaniganti on
thanks Raad it was working

we have restarted the server again then it was working & sorry for troubling you so much,

thanks
vamshi

Collapse
Posted by Raad Al-Rawi on
No problem!

Glad you got it in the end :)

<R>