A Warning - Mind Warp ahead This blog serves as in intermediary blog - a place where my ideas go to stew and mature (and sometimes die). For a more distilled reading of business and technical content please visit my company blog at http://marlindigitalagency.com

Wednesday, December 30, 2009

A Warning - Mind Warp ahead

This blog serves as in intermediary blog - a place where my ideas go to stew and mature (and sometimes die). The the brave of heart it is a look into my mind before all the polish that will take place in creating a single blog entry worthy of posting on my company website. For a more distilled and polished read I would visit my blog at Marlin Digital Agency. We just launched the site and it is out there for the world to see.

If you curious to see how a Social Digital Media Agency startup works this and the company blog are going to be blogs you don't want to miss.

:) Like I said though, you are more than welcome here - but I will be posting distilled thought on the company blog - but don't worry, I will let you know when I do!

Thanks for reading!

The Quest for a Thank You Message from Drupal's Webform Module

There is a way to send out a thank you message using the advanced php processing that drupal forms currently has:


$to = $form['submitted']['email']['#value'];
$from = variable_get('site_mail', '');
$body = drupal_html_to_text($node->webform['confirmation']);
$message = drupal_mail('webform_extra', 'reply', $to, language_default(), array('body' => $body), $from, TRUE);

function webform_extra_mail($key, &$message, $params) {
$message['subject'] = "Thanks for your interest.";
$message['body'] = $params['body'];

This is all well and good - however it is not very user friendly - here is what I propose:

Add an Auto-responder or Thank you Message in the Web-mail settings.
We need to collect the following data:
  • The field that will be used when sending the thank you message
  • The email Subject
  • The email Body
We will also need the remaining fields to be tokenized as well as having the other site information available.

All I want to accomplish here is when a user fills out a form they receive a thank you message

My approach is to build a custom module called 'webform_autoresponder'

____________________________________________________
My info file:

webform_autoresponder.info
***********************************************************************
; $Id: $
name = Webform AutoResonder
description = Enables Webforms to have a configurable Email Autoresponder field
core = 6.x

Right now I my schema will look something like this

____________________________________
NID / From / Subject / Message /
____________________________________

For the module itself I am using hook form alter to insert my fields where I would like them in the already existing webform edit form:


/**
* Implementation of hook_form_alter().
* Change the way an existing form is rendered
*/
function webform_autoresponder_form_webform_node_form_alter(&$form, &$form_state){
$form['webform']['mail_settings']['ar_from'] = array(
'#type' => 'textfield',
'#title' => t('From'),
'#description' => t('If you create a conditional email recipient based off a field this is the address that it will be emailed from'),
'#default_value' => 'confemail',
);
$form['webform']['mail_settings']['ar_subject'] = array(
'#type' => 'textfield',
'#title' => t('Subject'),
'#description' => t('If you create a conditional email recipient based off a field this is the subject that will be in the email to them'),
);
$form['webform']['mail_settings']['ar_confemail'] = array(
'#type' => 'textarea',
'#title' => t('Confirmation Email message'),
'#description' => t('If you create a conditional email recipient based off a field this is the body that will be emailed to them'),
'#default_value' => 'confemail',
'#cols' => 40,
'#rows' => 10,
);
}
Naturally as this module becomes more mature I will post more code and eventually commit it to the Drupal repository. Please leave any advise or suggestions

-Robert

Tuesday, December 29, 2009

A Brave New World - Far more social than I ever imagined

One of the most interesting things about the times I live in is watching our media change from simple one way communication from a handful of sources to a complex array of networks generated not only by traditional content distributers, but by our friends and family as well. A flashy ad in a newspaper fails to sell you something because of a passing negative comment by your uncle on Facebook. Part of my job is to make sure companies have the tools they need to analyze this new medium and provide real time "just in time" marketing to their products and services.

A big part of why I like the work I do is because of it's tendency to foster better transparency and communications between companies and individuals. In order for trust to be restored communication between customers and companies must flow unhindered in both directions. I believe that the customer's ability to share their experiences with other companies cheaply and easily will result in a more honest marketplace.

I would love to hear your ideas as we explore this Brave New World together - I plan to be covering a wide variety of topics from open source software to social media platforms and all the other tools we use at Marlin Digital to help companies compete in a new Marketscape.

Followers

About Me

My photo
I help people relate to other people better :) Preferring harmony over conflict I have been helping people relate better with one another since I was a kiddo.