Community & Support

Simplenews not producing full URLs

How do I make Simplenews produce a full URL in a newsletter? I created a simple newsletter, cut and pasted the URLs from my site into the HTML of the newsletter and did a test send to my email address. The resulting email looked fine but a) no images appeared (they were simple calls for the image to the site) and the links did not feature the front part of the domain (http:/www.blah.com/ etc ) , just the directories where the nodes were.

I know this is probably a really dumb question (and I am a newbie to Drupal) but does anyone have any ideas? Thanks in advance.

Comments

This is a feature that's not

This is a feature that's not yet available in simplenews. We're working on it, and it will be possible in a future release. For now, you'll have to type full url's (e.g. http://jourdomain.com/node/5), both in <a href=''> tags as well as in <img src=""> tags.

problem with htmlarea

I was trying to get images to show up in my emails for hours, and nothing happening - the links were being shortened. Then i turned off htmlarea (I had previously had it on, but was switching to html mode when copying over) and it all worked fine.

So the lesson learnt is - don't use htmlarea when building a html newsletter. I don't know if that was your problem, but it sorted it for me.

Now I need to exclude the "create newsletter" page from htmlarea settings - the problem is newsletters are plain nodes, so I can't specify which flexinode types to exclude, and I don't want to rule out all nodes. Any suggestions?

htmlarea

This workaround worked for me too, but I don;t think it's possible to exclude the simplenews mode specifically, unless someone can prove me wrong (quite likely).

mbites.com

simplenews tinymce

I have the same problem with tinymce. Everytime I put in the full url to the image it gets shortand. Of course trying this with tinymce turned off is an issue due to the fact I use image_assist, so the on/off icon is replaced by the image_assist icon.

Any body know of a work around, this would be appreciated. There must be one.

Regards,

Ashley
PS Thanks for raising this. My post got no responces. Clearly I didn't search correctly as I missed this thread before.

workaround with tinymce

This is not ideal as it requires manual work.

Try setting the default state under basic settings of admin/settings/tinymce/edit/<your tinymce profile> to false. Then create your newsletter and set the option for enable rich text to set up the format of your newsletter with g2images and using the tinymce module. Once you have the complete layout disable rich text again and edit the html <a href="relative site link"> and <img src="relative site link"> and include your domain before the first slash of the relative links you are provided with. If you have a lot of these you could use a text editor to find and replace <a href=" with <a href="your domain etc. When you submit your newsletter you should retain these full links.

Be warned: if you think of something else to add to your newsletter after editing the links and you enable rich text editing again all your links will be lost.

Set convert_urls to FALSE

You might be able to edit the TinyMCE library Javascript file to make it so that full URLs don't get converted into relative URLs. See http://tinymce.moxiecode.com/tinymce/docs/faq.html#paths The file you will be editing is, while inside your TinyMCE module directory, tinymce/jscripts/tiny_mce/tiny_mce.js.

(Username formerly my full name, Richard Eriksson.)

I have edited tinymce.module and inserted one line:

/**
* Return an array of initial tinymce config options from the current role.
*/

function tinymce_config($profile) {
global $user;

// Drupal theme path.
$themepath = path_to_theme() . '/';
$host = base_path();

$settings = $profile->settings;

// Build a default list of TinyMCE settings.

// Is tinymce on by default?
$status = tinymce_user_get_status($user, $profile);

$init['mode'] = $status == 'true' ? 'exact' : 'none';
$init['theme'] = $settings['theme'] ? $settings['theme'] : 'advanced';
$init['relative_urls'] = 'false';

//---------------- Inserted this line

$init['convert_urls'] = 'false';

//--------------------------------

$init['document_base_url'] = "$host";
$init['language'] = $settings['language'] ? $settings['language'] : 'en';
$init['safari_warning'] = $settings['safari_message'] ? $settings['safari_message'] : 'false';
$init['entity_encoding'] = 'raw';
$init['verify_html'] = $settings['verify_html'] ? $settings['verify_html'] : 'false';
$init['preformatted'] = $settings['preformatted'] ? $settings['preformatted'] : 'false';
$init['convert_fonts_to_styles'] = $settings['convert_fonts_to_styles'] ? $settings['convert_fonts_to_styles'] : 'false';

...

Now I can use full URLs in HTML-Newsletter with images shown correctly.

Newbie assitance

Does this also apply to Drupal 5.x? When you say "insert one line", what is all the other coder for?
I inserted the line, $init['convert_urls'] = 'false'; into the tinymce.module file at the bottom. What am I doing wrong.

PS: This seems to be the best solutions i found so far from hours of research. Thanks for the contribution.

------------------------------------------
www.ss-interactive.com

Dan

SuperDuperDan
www.superdorx.com

_

As this thread is almost 2 years old and both drupal and tinymce have had 1 or more upgrades since, it's unlikely this is still applicable. You may want to post in the module's issue queue for the tinymce drupal module you're using (wysiwyg.module or tinymce.module).

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.