Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

subscribe.pl change email subject line

Quote Reply
subscribe.pl change email subject line
I can't seem to add to the earlier thread with the same subject line, it seems to be locked or something, I'm still working on the same issue though.

I have what looks to be a simple change to the file - subscribe.eml. Every time a new message goes into the system, few and far between, they get sent out to all users via a cron that runs every 5 minutes.

At the moment I have this:

To: <%user_email%>
Subject: Bud Message Board
From: Bud <<%admin_email%>>
New message(s) posted to Bud: <%forum_name%>

---------------------------------------------------------------------------
<%loop post_loop%>
Subject: <%post_subject%>
Posted by: <%post_username%>
Posted on: <%post_date%>
<%post_message_text%>
---------------------------------------------------------------------------
<%endloop%>
<%if more_posts%>
Not all posts have been listed since the forum archive is limited to <%subscribe_email_max_posts%> posts. More posts can be found on the <%site_title%> site.
<%endif%>


I'm trying to change "Subject: Bud Message Board" to "Subject: <%post_subject%>" to reflect the subject in the email title.

I thought I'd just add that variable, since it was used below...but I get
(No Subject)?
in the email title if I do that. I then tried putting that loop command on either side of the email subject line, leaving the variable in the middle. Same results. Then used grep to try to find where that loop was originally coming from so I could try modifing a new loop command...no luck.

any help appreciated.

Last edited by:

steven99: Jun 1, 2013, 1:20 PM
Quote Reply
Re: [steven99] subscribe.pl change email subject line In reply to
Hi,

So you're trying to get the title of the post in the "Subject" header? Try:

Code:
<%post_loop.0.post_subject%>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] subscribe.pl change email subject line In reply to
thanks Andy, I'll plug that in and let you know. I feel better after looking at your mod, I never would have happened on that.
Quote Reply
Re: [Andy] subscribe.pl change email subject line In reply to
Andy, finally had a chance to see your slight mod in action. Funny enough, same results I got when I tried to mod it. Mail is sent out with the subject line reading:

(No Subject)


The body of the email does display the correct subject line from the post:

Subject: ONCE
Posted by: B T
Posted on: Jun 12, 2013, 11:03 PM

- body of message displayed here -

At the moment my eml file has this:


To: <%user_email%>
Subject: <%post_loop.0.post_subject%>
From: Bud <<%admin_email%>>
New message(s) posted to Bud: <%forum_name%>
---------------------------------------------------------------------------
<%loop post_loop%>
Subject: <%post_subject%>
Posted by: <%post_username%>
Posted on: <%post_date%>
<%post_message_text%>
---------------------------------------------------------------------------
<%endloop%>
<%if more_posts%>
Not all posts have been listed since the forum archive is limited to <%subscribe_email_max_posts%> posts. More posts can be found on the <%site_title%> site.
<%endif%>


Andy further help would be super. Steven

Last edited by:

steven99: Jun 12, 2013, 3:22 PM
Quote Reply
Re: [steven99] subscribe.pl change email subject line In reply to
Mmm, you could try a global:

get_first_subject

Code:
sub {
return {$_[0]}[0]->{post_subject}
}

Then call with:

Code:
Subject: <%get_first_subject($post_loop)%>

Untested, but that should work and give the value you're after (not sure why the other tag doesn't work - It may not be supported in that version of GForum)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!