# SPForm & Editing Values

**URL:** <https://community.modx.com/t/spform-editing-values/1067>\
**Category:** Development\
**Created:** [June 20, 2019, 5:03pm UTC](https://community.modx.com/t/spform-editing-values/1067 "2019-06-20T17:03:25Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Squashed\_Tomato](https://community.modx.com/user_avatar/community.modx.com/squashed_tomato/32/465_2.png) [@Squashed\_Tomato](https://community.modx.com/u/Squashed_Tomato)\
**Post date:** [June 20, 2019, 5:03pm UTC](https://community.modx.com/t/spform-editing-values/1067/1 "2019-06-20T17:03:25Z")

</div>

Hi all,  
I’m wondering how to edit/change/extend something and hope you can help.  
We’re using SPForm from @bobray to make a new(er) contact page with anti-spam options. Got that working so far and am happy with what we’ve got going.

There’s a few customisations I need to implement though.  
~~1, Can I change the redirect page? I’ve made another one with different text in it and would prefer to use this, as the current thank you page is a ‘thank you for your order’ one~~  
I’ve now fixed this, it was under the properties. ^

2, My CC email doesn’t come through. The contact one does. Anyone have this working or know how to do this? I.E have I missed something.

3, I have formed the style lovely on the page, but I also need to format the actual email CSS and content. CSS - I have drafted something up ready. Content: I need some additional lines and content in the actual received email.  
In the email for example, I can change ‘contact’ to what we wish, but can I include say for example, the name of the person contacting us? So My Business | Enquiry - From: Bob.

Does anyone know where I can edit these settings please?

I’ve edited my post a few times, as I’ve managed to work through some of them. 🙂

Thank you in advance for any help you can offer.  
Regards

---

<div class="post-metadata">

**Author:** ![nuan88](https://community.modx.com/user_avatar/community.modx.com/nuan88/32/350_2.png) [@nuan88](https://community.modx.com/u/nuan88)\
**Post date:** [June 20, 2019, 7:09pm UTC](https://community.modx.com/t/spform-editing-values/1067/2 "2019-06-20T19:09:17Z")

</div>

try using bcc instead of cc, I think that works

i don’t think there is a tpl for the output, in the SPForm snippet you can change the email subject line (in properties)

you can use a custom tpl of course

---

<div class="post-metadata">

**Author:** ![Squashed\_Tomato](https://community.modx.com/user_avatar/community.modx.com/squashed_tomato/32/465_2.png) [@Squashed\_Tomato](https://community.modx.com/u/Squashed_Tomato)\
**Post date:** [June 20, 2019, 7:12pm UTC](https://community.modx.com/t/spform-editing-values/1067/3 "2019-06-20T19:12:36Z")

</div>

Hi @nuan88 Thank you for taking the time to reply.

> [@nuan88](#):
>
> try using bcc instead of cc, I think that works

Is this on the SPform snippet?

> [@nuan88](#):
>
> i don’t think there is a tpl for the output, in the SPForm snippet you can change the email subject line (in properties)
> 
> you can use a custom tpl of course

Okay so it’s not something I can do by default? If not then I will indeed look at making a custom one and including it.  
Thank you! 🙂

---

<div class="post-metadata">

**Author:** ![bobray](https://community.modx.com/user_avatar/community.modx.com/bobray/32/46_2.png) [@bobray](https://community.modx.com/u/bobray)\
**Post date:** [June 20, 2019, 9:33pm UTC](https://community.modx.com/t/spform-editing-values/1067/4 "2019-06-20T21:33:17Z")

</div>

Are you using `&mailAlso=`bob@somewhere.com`` for the CC?

If not, try that.

---

<div class="post-metadata">

**Author:** ![Squashed\_Tomato](https://community.modx.com/user_avatar/community.modx.com/squashed_tomato/32/465_2.png) [@Squashed\_Tomato](https://community.modx.com/u/Squashed_Tomato)\
**Post date:** [June 20, 2019, 9:37pm UTC](https://community.modx.com/t/spform-editing-values/1067/5 "2019-06-20T21:37:54Z")

</div>

Hi,

> [@bobray](#):
>
> Are you using `&mailAlso=`bob@somewhere.com`` for the CC?
> 
> If not, try that.

Okay I will try that now. Thank you! 🙂

Sorry, where should I add this?

---

<div class="post-metadata">

**Author:** ![nuan88](https://community.modx.com/user_avatar/community.modx.com/nuan88/32/350_2.png) [@nuan88](https://community.modx.com/u/nuan88)\
**Post date:** [June 20, 2019, 9:38pm UTC](https://community.modx.com/t/spform-editing-values/1067/6 "2019-06-20T21:38:59Z")

</div>

No sorry, I wasn’t clear.

Go to the SPForm snippet, in the Elements section, with the templates, chunks and snippets.

Then, click on that snippet and go to properties. What BobRay has done is put most the variables into these properties, so they can be changed on the fly. Pls check the attached picture for an example of the values you can control in those properties.

 ![values](https://modx-community.s3.dualstack.us-east-1.amazonaws.com/original/1X/2667dbbf348385a168e7c06496701dcbe9b5f3a6.png)

Here is Bob’s page with most of your answers, for example you can make your custom css for the email with [[!SPFResponse? &spfCssPath=`path_to_your_css_file`]]

> **[Bob's Guides | SPForm Snippet](https://bobsguides.com/spform-tutorial.html)**
>
> SPForm is a really simple e-mail contact form that is as spam-proof as I could make it. It creates a contact form like the one at this site.

This form should be pretty spam proof, so you will be good to go once implemented

---

<div class="post-metadata">

**Author:** ![Squashed\_Tomato](https://community.modx.com/user_avatar/community.modx.com/squashed_tomato/32/465_2.png) [@Squashed\_Tomato](https://community.modx.com/u/Squashed_Tomato)\
**Post date:** [June 20, 2019, 9:43pm UTC](https://community.modx.com/t/spform-editing-values/1067/7 "2019-06-20T21:43:18Z")

</div>

Sorry - where should I add this exactly please?

This what I have entered…

 ![1](https://modx-community.s3.dualstack.us-east-1.amazonaws.com/original/1X/a08c325ec25d34c84869fab97247f8a0ca0003f6.png)

---

<div class="post-metadata">

**Author:** ![Squashed\_Tomato](https://community.modx.com/user_avatar/community.modx.com/squashed_tomato/32/465_2.png) [@Squashed\_Tomato](https://community.modx.com/u/Squashed_Tomato)\
**Post date:** [June 20, 2019, 9:46pm UTC](https://community.modx.com/t/spform-editing-values/1067/8 "2019-06-20T21:46:22Z")

</div>

> [@nuan88](#):
>
> No sorry, I wasn’t clear.
> 
> Go to the SPForm snippet, in the Elements section, with the templates, chunks and snippets.
> 
> Then, click on that snippet and go to properties. What BobRay has done is put most the variables into these properties, so they can be changed on the fly. Pls check the attached picture for an example of the values you can control in those properties.
> 
> ![values.png](https://modx-community.s3.dualstack.us-east-1.amazonaws.com/original/1X/2667dbbf348385a168e7c06496701dcbe9b5f3a6.png)
> 
> Here is Bob’s page with most of your answers, for example you can make your custom css for the email with [[!SPFResponse? &spfCssPath= `path_to_your_css_file`]]

Hi,  
Thank you. I have added the mail there but not working.  
How do you bcc from there?  
Also, I have managed to sort the CSS for the contact form but not sure how I edit it for the form received for the incoming emails you then get?  
So is the SPFResponse what I need to edit, in order to amend the incoming mail’s CSS?  
Thank you again. Much appreciated.

---

<div class="post-metadata">

**Author:** ![bobray](https://community.modx.com/user_avatar/community.modx.com/bobray/32/46_2.png) [@bobray](https://community.modx.com/u/bobray)\
**Post date:** [June 20, 2019, 10:05pm UTC](https://community.modx.com/t/spform-editing-values/1067/9 "2019-06-20T22:05:06Z")

</div>

Try putting it in the SPForm snippet tag.

About styling the actual email sent, there’s no easy way to do that. I’m afraid SPForm was one of the first extras I ever wrote (IIRC, in 2008, maybe my very first extra), and I never thought about that. It was intended as a quick-and-dirty spam-proof contact form that needed very little configuration and worked once it was installed.

You would have to modify the $\_content variable (which holds the message the user entered) in the spformproc.inc.php file around line 601, and modify or remove line 377 of that file. Your changes would be overwritten by an upgrade of SPForm, but there isn’t one planned any time soon.

---

<div class="post-metadata">

**Author:** ![Squashed\_Tomato](https://community.modx.com/user_avatar/community.modx.com/squashed_tomato/32/465_2.png) [@Squashed\_Tomato](https://community.modx.com/u/Squashed_Tomato)\
**Post date:** [June 20, 2019, 10:10pm UTC](https://community.modx.com/t/spform-editing-values/1067/10 "2019-06-20T22:10:12Z")

</div>

Just so I am really clear, do you mean in here or somewhere else?

 ![1](https://modx-community.s3.dualstack.us-east-1.amazonaws.com/original/1X/a08c325ec25d34c84869fab97247f8a0ca0003f6.png)  
Bearing in mind I am really new to this… Sorry for any silly questions. Really trying to work as best I can on my own.  
Or, do you mean the actual php core file itself? spfconfig.cfg.php

Ohh okay thank you. Yes I didn’t think it would be easy as it is hardcoded - I definitely get why you did it like this. Just need to add a few more things to it.  
To be honest, I will give it a good go but if it’s more hassle than what it’s worth, I will leave it as is. 😃

---

<div class="post-metadata">

**Author:** ![bobray](https://community.modx.com/user_avatar/community.modx.com/bobray/32/46_2.png) [@bobray](https://community.modx.com/u/bobray)\
**Post date:** [June 20, 2019, 10:41pm UTC](https://community.modx.com/t/spform-editing-values/1067/11 "2019-06-20T22:41:10Z")

</div>

That would work, though in that location, you’d leave out the quotes/back-ticks and your change would be overwritten by an upgrade of SPForm.

A better place would be in the SPForm snippet tag on your contact page:

```auto
[[!SPForm? 
   &formProcAllowedReferers=`yoursite.com`
   &errorsTo=`youremail@gmail.com`
   &mailAlso=`somebody@somewhere.com`
   &spfResponseID=`229`
   &recipientArray=`someEmail@somewhere.com`
   &spformTpl=`YourContactFormTpl`
   &requireVerify=`1`
]]

```

Be sure to use back-ticks, not single quotes, and the properties are case-sensitive so it has to be `&mailAlso`.

In general, with MODX extras, any snippet property value (from the list in your image) that you want to override from its default value should be put in the snippet tag with the value in back-ticks. That way, your values will survive any upgrades to the extra.

Any properties that you want to use the default for can be left out of the snippet tag. The extra will get their values from the default properties on the tab you see when editing the snippet.

Don’t worry about asking what you think are dumb questions. We were all newbies at one time. 🙂

---

<div class="post-metadata">

**Author:** ![Squashed\_Tomato](https://community.modx.com/user_avatar/community.modx.com/squashed_tomato/32/465_2.png) [@Squashed\_Tomato](https://community.modx.com/u/Squashed_Tomato)\
**Post date:** [June 20, 2019, 10:59pm UTC](https://community.modx.com/t/spform-editing-values/1067/12 "2019-06-20T22:59:59Z")

</div>

Got you!  
Okay thank you…  
Will definitely have another go tomorrow (almost midnight again (GMT) here) and see what I can do.  
But your post definitely makes sense & I can see what you mean.  
I’ve already made a child of things. So I know I can amend things on the fly & if errors appear, either retract or scrub.  
Thank you and I agree. I think back about some things and how easy it can be to look at newbs and think “Oh you haven’t a clue…” but it takes time to adjust - especially if used to a plethora of technologies.  
Aside from the abrupt sink or swim I was given, I am slowly starting to enjoy this and like what it is all about. Even though it’s many years old and not a new kid on the block, so to speak.  
Thank you again, will have a go in the morning. I appreciate your help!  
Regards  
ST.

---

<div class="post-metadata">

**Author:** ![nuan88](https://community.modx.com/user_avatar/community.modx.com/nuan88/32/350_2.png) [@nuan88](https://community.modx.com/u/nuan88)\
**Post date:** [June 21, 2019, 2:09pm UTC](https://community.modx.com/t/spform-editing-values/1067/13 "2019-06-21T14:09:08Z")

</div>

Yeah it always takes a bit of time. With something like Wordpress, things are easier but security is not and you don’t actually have that much control. Modx sites also can last a very long time, as you can see from your system.

I think we can break it down like this:

head info includes normal stuff but some key modx code too.

header is usually just a pic and links, there are very simple tools that give you the links. And they can be/are dynamic so, in another context, you can just throw a new resource into a folder in your tree and have the resource be included instantly, no hard coding. Unusual for a banner but consider a list of FAQ questions.

content - this is your html/css, with no adjustments. But you can still stuff into this structure, in divs, that is dynamic. Like you can place a floating ad in the middle of that html.

Lots of tools to get stuff, like a folder of images or a list of product pages. output all employee’s pictures and contact info, or anything really. These can be pretty involved.

chunks - primarily for html and a few other types of code. great for stuff you want to keep all together, whether for quick updating or so you can customize the content you give the visitor

snippets - tools to do stuff with php. Grab the list of logged in users, or grab local contents, or grab anything and manipulate and display or record things. This is the real power because you can pretty much do anything with custom snippets.

For example, someone on the old forum made a snippet years ago that, upon user registration, calculated the time of registration and saved that data to a user field (that was before Modx did it by default).

---

<div class="post-metadata">

**Author:** ![Squashed\_Tomato](https://community.modx.com/user_avatar/community.modx.com/squashed_tomato/32/465_2.png) [@Squashed\_Tomato](https://community.modx.com/u/Squashed_Tomato)\
**Post date:** [June 21, 2019, 5:24pm UTC](https://community.modx.com/t/spform-editing-values/1067/14 "2019-06-21T17:24:23Z")

</div>

> [@bobray](#):
>
> Be sure to use back-ticks, not single quotes, and the properties are case-sensitive so it has to be `&mailAlso` .
> 
> In general, with MODX extras, any snippet property value (from the list in your image) that you want to override from its default value should be put in the snippet tag with the value in back-ticks. That way, your values will survive any upgrades to the extra.
> 
> Any properties that you want to use the default for can be left out of the snippet tag. The extra will get their values from the default properties on the tab you see when editing the snippet.
> 
> Don’t worry about asking what you think are dumb questions. We were all newbies at one time. 🙂

Hi,  
~~Sorry to be a pain but I entered this on the form, using your pre-built contact form and it throws this error;  
“[whateverEmailAddress@gmail.com](mailto:whateverEmailAddress@gmail.com)” is an invalid destination. Sorry…~~

Okay so now have it working but no CC email I’m afraid to say.

---

<div class="post-metadata">

**Author:** ![nuan88](https://community.modx.com/user_avatar/community.modx.com/nuan88/32/350_2.png) [@nuan88](https://community.modx.com/u/nuan88)\
**Post date:** [June 21, 2019, 6:07pm UTC](https://community.modx.com/t/spform-editing-values/1067/15 "2019-06-21T18:07:26Z")

</div>

This doesn’t work?

```auto
&mailAlso=`somebody@somewhere.com

```

I believe you can also add the mail into this list

```auto
  &recipientArray=`someEmail@somewhere.com, someotheremail@somewhere.com`

```

---

<div class="post-metadata">

**Author:** ![Squashed\_Tomato](https://community.modx.com/user_avatar/community.modx.com/squashed_tomato/32/465_2.png) [@Squashed\_Tomato](https://community.modx.com/u/Squashed_Tomato)\
**Post date:** [June 21, 2019, 6:33pm UTC](https://community.modx.com/t/spform-editing-values/1067/16 "2019-06-21T18:33:50Z")

</div>

No didn’t get the email.

> [@nuan88](#):
>
> [someEmail@somewhere.com](mailto:someEmail@somewhere.com), someotheremail@somewhere.com`

How would that look for the contact page please?  
I think I’ve done it all right, but the emails are going through for the contact, but not the CC. It’s not life or death though so I can omit it.  
And thank you again. 🙂

---

<div class="post-metadata">

**Author:** ![nuan88](https://community.modx.com/user_avatar/community.modx.com/nuan88/32/350_2.png) [@nuan88](https://community.modx.com/u/nuan88)\
**Post date:** [June 21, 2019, 8:49pm UTC](https://community.modx.com/t/spform-editing-values/1067/17 "2019-06-21T20:49:25Z")

</div>

Here is the code of the SPForm snippet that BobRay posted before. I don’t know why the mailAlso doesn’t seem to work, but you can put the extra email in the array of emails to send to, that’s &recipientArray. This array can have several emails included, so all your cc emails can go in here, all within the single ticks and separated by commas but not spaces

```auto
[[!SPForm? 
   &formProcAllowedReferers=`yoursite.com`
   &errorsTo=`youremail@gmail.com`
   &mailAlso=`somebody@somewhere.com`
   &spfResponseID=`229`
   &recipientArray=`someEmail@somewhere.com`
   &spformTpl=`YourContactFormTpl`
   &requireVerify=`1`
]]

```

So,

```auto
&recipientArray=`maincontact@domain1.com,secondemail@domain1.com,thirdemail@domain1.com`

```

---

<div class="post-metadata">

**Author:** ![zombieDan](https://community.modx.com/letter_avatar_proxy/v4/letter/z/4da419/32.png) [@zombieDan](https://community.modx.com/u/zombieDan)\
**Post date:** [January 30, 2021, 1:02am UTC](https://community.modx.com/t/spform-editing-values/1067/18 "2021-01-30T01:02:45Z")

</div>

Hi bobray,

Do you now how can i edit this values?

[[+spf-name-prompt]]

[[+spf-email-prompt]]

[[+spf-subject-prompt]]

thanks !

---

<div class="post-metadata">

**Author:** ![bobray](https://community.modx.com/user_avatar/community.modx.com/bobray/32/46_2.png) [@bobray](https://community.modx.com/u/bobray)\
**Post date:** [February 1, 2021, 8:49pm UTC](https://community.modx.com/t/spform-editing-values/1067/19 "2021-02-01T20:49:16Z")

</div>

You should see them in the Tpl chunk in the SPForm category.
