Example 6

Top  Previous  Next

This filter script is designed to work with an SMS Replies system and is configured so that any time someone replies to a message with 'unsubscribe' or 'subscribe', those replies will be sent to an 'unsubscribe' or 'subscribe' recipient in PageGate that will execute a batch file or script contained within a batch file.

 

To do so, there's a bit of preparation you'll need to do to tell PageGate what script to run. It's also important to note that this batch file can be used to execute powershell commands.

 

Step 1: Create a directory for your batch file

1)Create a directory for the batch file(s) to reside in. This will also be the output folder for the carrier we'll create in Step 2. For example, c:\PageGateData\unsubscribe\

 

Step 2: Create a FILE Carrier

1)Open PG Admin.

2)Right click Carriers, select Add.

3)Give the carrier a name, something straightforward like BATCH.

4)Set Protocol to: FILE

5)Set File Path to the directory you created in Step 1 above. By default, c:\PageGateData\unsubscribe\

 

Step 3: Create a recipient named 'unsubscribe' and tie it to the FILE carrier

1)Right click Recipients, select Add.

2)Name the recipient: unsubscribe

3)Set Carrier to the FILE carrier you created in step 2. By default, BATCH.

4)Click Apply.

 

Step 4: Place and edit the appropriate script files

1)Open the directory you created in step 1 above. By default, c:\PageGateData\unsubscribe\

2)Copy pstproc.bat from the PageGate program directory in to that folder.

3)Edit pstproc.bat to execute the desired effect.

 

Step 5: Configure the SMS Replies Filter System

# look for 'unsubscribe' in message text

# if found, route the message to 'unsubscribe' recipient

<Filter>

 <Search>

         <Section>

                 Message

         </Section>

         <Type>

                 Literal

         </Type>

         <Text>

                 unsubscribe

         </Text>

 </Search>

 <Replace>

         <Section>

                 Recipient

         </Section>

         <Scope>

                 Section

         </Scope>

         <Text>

                 unsubscribe-recipient

         </Text>

 </Replace>

 <Continue>

         False

 </Continue>

</Filter>

 

# look for 'Unsubscribe' in message text

# if found, route the message to 'unsubscribe' recipient

<Filter>

 <Search>

         <Section>

                 Message

         </Section>

         <Type>

                 Literal

         </Type>

         <Text>

                 Unsubscribe

         </Text>

 </Search>

 <Replace>

         <Section>

                 Recipient

         </Section>

         <Scope>

                 Section

         </Scope>

         <Text>

                 unsubscribe-recipient

         </Text>

 </Replace>

 <Continue>

         False

 </Continue>

</Filter>

 

# look for 'subscribe' in message text

# if found, route the message to 'subscribe' recipient

<Filter>

 <Search>

         <Section>

                 Message

         </Section>

         <Type>

                 Literal

         </Type>

         <Text>

                 subscribe

         </Text>

 </Search>

 <Replace>

         <Section>

                 Recipient

         </Section>

         <Scope>

                 Section

         </Scope>

         <Text>

                 subscribe-recipient

         </Text>

 </Replace>

 <Continue>

         False

 </Continue>

</Filter>

 

# look for 'Subscribe' in message text

# if found, route the message to 'subscribe' recipient

<Filter>

 <Search>

         <Section>

                 Message

         </Section>

         <Type>

                 Literal

         </Type>

         <Text>

                 Subscribe

         </Text>

 </Search>

 <Replace>

         <Section>

                 Recipient

         </Section>

         <Scope>

                 Section

         </Scope>

         <Text>

                 subscribe-recipient

         </Text>

 </Replace>

 <Continue>

         False

 </Continue>

</Filter>