Automate your leads with Marketing Campaigns

132 • object.state = ‘pending’ and re.search‘Plan to sell:.True’,object.description and not re.search‘Plan to use:.True’,object.description would be true if the lead is NOT in Pending state and it contains “Plan to sell” but not “Plan to use”

11.3.3 Guidelines for creating a campaign

• It is a good idea to have an initial activity that will change some fields on the objects entering the campaign to mark them as such, and avoid mixing them in other processes e.g. set a specific state and Sales Team on a CRM lead being processed by a campaign. You can also define a time delay so that the campaign seems more human note if the answer comes in a matter of seconds or minutes it is computer generated. • Put a stop condition on each subsequent activity in the campaign to get items out of the campaign as soon as the goal is achieved e.g. every activity has a partial condition on the state of the item, if CRM Leads stops being Pending, the campaign ends for that case. 2. Email Templates Marketing → Configuration → Email Template → Templates Email templates are composed of the following information: • The Email headers: to, from, cc, bcc, subject • The raw HTML body, with the low-level markup and formatting • The plaintext body Headers and bodies can contain placeholders for dynamic contents that will be replaced in the final email with the actual content. 3. Campaign Segments Segments are processed automatically according to a predefined schedule set in the menu Administration → Configuration → Scheduled Actions. It could be set to process every 4 hours or every minute for example. This is the only entry point in a campaign at the moment. Segment filters Segments select resources via filters, exactly the same kind of filter that can be used in advanced search views on any list in OpenERP. You can actually create them easily by saving your advanced search criteria as new filters. Filters mainly consist in a domain expressing the criteria of selection on a model the resource. See the section 10.3 at the bottom for more information on the syntax for these filters. For Leads, the following filter would select draft Leads from any European country with “Plan for use: True” or “Plan for sell: False” specified in the body: | [ ‘type’,’=’,’lead’, | ‘state’, ‘=’, ‘draft’, | ‘country_id.name’, ‘in’, [’Belgium’, | ‘Netherlands’, | ‘Luxembourg’, | ‘United Kingdom’, | ‘France’, | ‘Germany’, | ‘Finland’, | ‘Denmark’, | ‘Norway’, | ‘Austria’, | ‘Switzerland’, | ‘Italy’, | ‘Spain’, | ‘Portugal’, | ‘Ireland’, | ], | ‘|’, | ‘description’, ‘ilike’, ‘Plan for use: True’, | ‘description’, ‘ilike’, ‘Plan for sell: False’ | ] 6. Miscellaneous References, Examples 6.1 Reference of Comparison Operators: • ==: Equal • =: Not Equal • : Bigger than • : Smaller Than • =: Bigger than or equal to • =: Smaller than or equal to • in: to check that a given text is included somewhere in another text. e.g “a” in “dabc” is True 6.2 Reference of PatternWildcard characters • . dot represents any character but just one 133 • means that the previous pattern can be repeated 0 or more times • + means that the previous pattern can be repeated 1 or more times • ? means that the previous pattern is optional 0 or 1 times • . would represent any character, repeated in 0 or more occurencies • .+ would represent at least 1 character but any • 5? would represent an optional 5 character 6.3 Reference of filter domains Generic format is: [ criterion_1, criterion_2 ] to filter for resources matching both criterions. It is possible to combine criterions differently with the following operators: • ‘’ is the boolean AND operator and will make a new criterion by combining the next 2 criterions always 2. This is also the implicit operator when no operator is specified. – for example: [ criterion_1, ‘’, criterion_2, criterion_3 ] means criterion_1 AND criterion_2 AND criterion_3 • ‘|’ is the boolean OR operator and will make a new criterion by combining the next 2 criterions always 2 – for example: [ criterion_1, ‘|’, criterion_2, criterion_3 ] means criterion_1 AND criterion_2 OR criterion_3 • ‘’ is the boolean NOT operator and will make a new criterion by reversing the value of the next criterion always only 1 – for example: [ criterion_1, ‘’, criterion_2, criterion_3 ] means criterion_1 AND NOT criterion_2 AND criterion_3 Criterion format is: ‘field_path_operand’, ‘operator’, value Where: • field_path_operand specifies the name of an attribute or a path starting with an attribute to reach the value we want to compare • operator is one of the possible operator: – ‘=’ , ‘=’ : equal and different – ‘’, ‘’, ‘=’, ‘=’ : greater or lower than or equal – ‘in’, ‘not in’ : present or absent in a list of value. Values must be specified as [ value1, value2 ], e.g. [ ‘Belgium’, ‘Croatia’ ] – ‘ilike’ : search for string value in the operand • value is the text or number or list value to compare with field_path_operand using comparator