Making changes to NMS default message

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
volume
Forum Members
Forum Members
Posts: 15
Joined: Tue May 30, 2006 5:45 pm

Making changes to NMS default message

Post by volume »

Hello All,

I am using the NMS module [v:1.0-beta1 ] and correct dependants with cmsmadesimple [v:0.13].

Amongst other things I was hoping to change the wording of the default message (you know - compose message). I made what I thought was the correct changes to the NMS.module.php file. And the result?? ...Not a bloody thing! (excuse my excitement). No [known] errors, and the code I exchaged was some straightforward html to replace the existing html (message).

Any thoughts as to why I saw absolutely no change whatsoever? SHould I have changed another file instead/including...?

Any feedback/thoughts are welcomed.

Thanks,

volume.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Making changes to NMS default message

Post by calguy1000 »

Because the $default_message_template is set as a preference......
so changing it in the code won't do anything atm.    My Intent is to put that stuff into yet another tab to allow you to change it in the gui, just haven't gotten there yet.

What you can do though, is change this line:

Code: Select all

$params['message_text'] = $this->GetPreference('default_message_template','');
to

Code: Select all

$params['message_text'] = $this->default_message_template;
Then everything should work fine.  I'll try to attack this tonite, as soon as I finish once and for all this stupid expiry date issue in feusers :)
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
volume
Forum Members
Forum Members
Posts: 15
Joined: Tue May 30, 2006 5:45 pm

Re: Making changes to NMS default message

Post by volume »

Worked a treat! ... Thanks for the exact answer in record time.

I have a couple more NMS questions, but I will post them in seperate topic as I'm sure more folk will benefit ... especially me :)

Thanks again.

volume

btw Congrats on a a great module [NMS].
volume
Forum Members
Forum Members
Posts: 15
Joined: Tue May 30, 2006 5:45 pm

Re: Making changes to NMS default message

Post by volume »

I'm adding a little more to this thread, but it's relevant so I guess that's okay...

As mentioned before the solution suggested by 'callguy1000' worked a treat. However I've altered the html email since the first draft and uploaded it [NMS.module.php]. The weird thing is, when I click on 'compose message' within NMS the first draft is shown and not the expected latest version. Does this make sense at all  ???? I've checked, and rechecked and the file[NMS.module.php] is in the correct location. Once again I am stuck. Any thoughts?

cheers,

volume
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Making changes to NMS default message

Post by calguy1000 »

The template strings themselves are loaded into the database on install.  I don't have access atm to see exactly which features are available where, but since you changed the default message, you may have to click "Restore Defaults" or whatever the button is to reset the database templates with the values from the NMS.module.php file.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
volume
Forum Members
Forum Members
Posts: 15
Joined: Tue May 30, 2006 5:45 pm

Re: Making changes to NMS default message

Post by volume »

Hello [again] callguy,

There is no 'reset to default' for the 'compose message' as far as I'm aware. However I will play with the database entry - I'm sure that will do the trick.

Thanks again...

volume
volume
Forum Members
Forum Members
Posts: 15
Joined: Tue May 30, 2006 5:45 pm

Re: Making changes to NMS default message

Post by volume »

Just to continue...

I went into the database and could see all but the default message [the one I was talking about anyway - 'compose message'].

For the record I found the following NMS templates in the database:

usersettings_email_body; usersettings_form; usersettings_form2; post_unsubscribe_text; unsubscribe_email_body; post_email_confirm_message; unsubscribe_text; confirm_email_body; nms_unsubscribeform; nms_subscribeform; subscribe_email_body; usersettings_text; usersettings_text2

No sign of the message that I'm after. What says you?

Cheers,

volume
volume
Forum Members
Forum Members
Posts: 15
Joined: Tue May 30, 2006 5:45 pm

Re: Making changes to NMS default message

Post by volume »

Whoa...I said whoa there boy. Before anyone [most likely callguy] goes to any trouble - don't! It's my fault  :-[ I've got two NMS.module.php files on my machine, and yes I've been making changes to one file and uploading the other one unknowingly. And to think I got dressed on my own today as well. Aw drats.

Thanks for your help anyway callguy, it wasn't a complete waste of time. Think I'll shuffle off now...

volume.
NomadSoul
Forum Members
Forum Members
Posts: 24
Joined: Tue Jul 25, 2006 12:45 am
Location: BE

Re: Making changes to NMS default message

Post by NomadSoul »

hello, ... and thank you for this realy nice newsletter module!

I used same method as described in previous posts:
- I modified NMS.module.php
- I changed $params['message_text'] to this value: $this->default_message_template;
- I changed var $default_message_template with a new HTML content.

All work great...

But after that I tried to use CSS stylesheet tags inside the HTML content and I had Smarty errors each time...
So... I removed all that stuff

Code: Select all

var $default_message_template = '
<__html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style>
.liste { text-indent: 41px; text-align: left; }
.liste10px { text-indent: 10px; text-align: left; }
.txt { color: black; font-size: 11px; line-height: 13px; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; text-align: justify }
(etc... etc...)
... and I don't have Smarty errors anymore.

But now I have this error in the Newsletter Made Simple Processing Job:
"Keep this window open till all messages have been sent.
DEBUG: got an error (temporary table exists)"

my questions:
- how can I insert stylesheet information in NMS default message template?
- any idea about this "temporary table exists" error?


EDIT: NMS version: 1.0-Beta3
(I downloaded NMS-1.0-Beta5.xml but I don't know how to use it?)
Last edited by NomadSoul on Sun Jul 30, 2006 2:31 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Making changes to NMS default message

Post by calguy1000 »

any thing with curly braces { and } has to be wrapped in {literal} and {/literal} tags so that smarty doesn't try to process it.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
NomadSoul
Forum Members
Forum Members
Posts: 24
Joined: Tue Jul 25, 2006 12:45 am
Location: BE

Re: Making changes to NMS default message

Post by NomadSoul »

Indeed this works nicely:

Code: Select all

{literal}
<style>
--all my css stuff--
</style>
{/literal}
-> about "temporary table exists" bug, like you said on #cms, I dropped the temporary jobs table in PhpMyAdmin and it was ok.
-> to use NMS-1.0-Beta5.xml (and xml files in general), it needs cmsms 1.0 Beta2 +

Thanks for answers calguy1000 8)
EMR53
Forum Members
Forum Members
Posts: 31
Joined: Tue Aug 01, 2006 6:09 pm

Re: Making changes to NMS default message

Post by EMR53 »

Hello,

NMS is a great module, but i dont want to choose every time for a template, i want just a default one.

I'm was searching for a solution , and found this rather old topic about the News Letter module.
I'm struggling with the same question about setting a default template.

The solutions given here do not apply for my version of NMS 1.0.2.

I modified NMS.module.php
- I changed $params['message_text'] to this value: $this->default_message_template;
- I changed var $default_message_template with a new HTML content

i cant find the $params['message_text']  code

Can anybody tell me how to change it in that version. I did a upgrade of all messages boxes in dutch. So an upgrade will reset all that, thats why i did not try that yet.

Thanks in advance Eric
Post Reply

Return to “Modules/Add-Ons”