summaryrefslogtreecommitdiff
path: root/templates/send_newsletters.tpl
blob: bb1d0c3cfc6c09bdac9e5f1e9a7fd66106eb359a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{strip}
<div class="floaticon">{bithelp}</div>

<div class="edit newsletters">
	<div class="header">
		<h1>{tr}Send Newsletter{/tr}{if $gContent->isValid()}: {$gContent->getTitle()}{/if}</h1>
	</div>

	<div class="body">
		{if $feedback}
			<div class="form-group">
				{formfeedback hash=$feedback}
			</div>
		{/if}

		{if $gContent->isValid()}
			{form}
				<input type="hidden" name="edition_id" value="{$gContent->mEditionId|escape}" />

				{if $smarty.request.emited eq 'y'}
					{tr}The newsletter was sent to {$sent} email addresses{/tr}
				{elseif $smarty.request.preview}
					<input type="hidden" name="validated" value="{$smarty.request.validated}" />
					<input type="hidden" name="test_mode" value="{$smarty.request.test_mode}" />
					{jstabs}
						{jstab title="Preview Newsletter"}
							{legend legend="Preview Newsletter"}
								{include file="bitpackage:newsletters/view_edition.tpl"}
							{/legend}
						{/jstab}

						{jstab title="Preview Recipient List"}
							{legend legend="Preview Recipient List"}
								<div class="form-group">
									{foreach from=$smarty.request.send_group item=groupId key=i}
										<input type="hidden" name="send_group[]" value="{$groupId}" />
									{/foreach}

									{formlabel label="Actual Recipients"}
									{forminput}
										<ol>
											{foreach from=$recipientList item=recipient key=email}
												<li>{$recipient.login} &nbsp; &lt;{$email}&gt;</li>
											{/foreach}
										</ol>
									{/forminput}
								</div>
							{/legend}
						{/jstab}
					{/jstabs}

					<div class="form-group submit">
						<input type="submit" class="btn btn-default" name="cancel" value="{tr}Cancel{/tr}" />
						<input type="submit" class="btn btn-default" name="send" value="{tr}Send{/tr}" />
					</div>
				{else}
					{legend legend="Recipient Groups"}
						<div class="form-group">
							{formlabel label="Groups"}
							{forminput}
								{foreach from=$groupList item=group key=groupId }
									<label><input type="checkbox" name="send_group[]" value="{$groupId}" /> {$group.group_name}</label><br />
								{/foreach}
								{formhelp note="This newsletter will be sent to members of the checked groups."}
							{/forminput}
						</div>

						<div class="form-group">
							{forminput label="checkbox"}
								<input type="checkbox" name="test_mode" />Send Test
								{formhelp note="This will enable you to send the newsletter to the same recipients again."}
							{/forminput}
						</div>
{*
						<div class="form-group">
							{formlabel label="Only send to validated emails"}
							{forminput}
								<input type="checkbox" name="validated" checked="checked" />
							{/forminput}
						</div>
*}
						<div class="form-group submit">
							<input type="submit" class="btn btn-default" name="preview" value="{tr}Preview{/tr}" />
						</div>
					{/legend}
				{/if}
			{/form}
		{else}
			{minifind}
			<h2>{tr}Sent editions{/tr}</h2>
			{include file="bitpackage:newsletters/list_editions_inc.tpl"}
			{pagination}
		{/if}
	</div><!-- end .body -->
</div>
{/strip}