comparison frontends/src/jp/cmd_event.py @ 2291:c05000d00dbb

plugin events, invitations + jp (event/create, invitation/invitee/invite): several emails addresses can now be specified for a single invitation: if several addresses are specified, the same invitation (same ID and data) is sent to all the addresses
author Goffi <goffi@goffi.org>
date Fri, 30 Jun 2017 00:04:47 +0200
parents f4d8d83a50e2
children a3cd2ac25d58
comparison
equal deleted inserted replaced
2290:d5c75be1c8c0 2291:c05000d00dbb
202 base.CommandBase.__init__(self, host, 'invite', use_pubsub_node_req=True, help=_(u'invite someone to the event through email')) 202 base.CommandBase.__init__(self, host, 'invite', use_pubsub_node_req=True, help=_(u'invite someone to the event through email'))
203 self.need_loop=True 203 self.need_loop=True
204 204
205 def add_parser_options(self): 205 def add_parser_options(self):
206 self.parser.add_argument("-i", "--item", type=base.unicode_decoder, default=u'', help=_(u"ID of the PubSub Item")) 206 self.parser.add_argument("-i", "--item", type=base.unicode_decoder, default=u'', help=_(u"ID of the PubSub Item"))
207 self.parser.add_argument("-e", "--email", type=base.unicode_decoder, default='', help='email to send the invitation to (if --no-email is set, email will just be saved)') 207 self.parser.add_argument("-e", "--email", action="append", type=base.unicode_decoder, default=[], help='email(s) to send the invitation to')
208 self.parser.add_argument("-n", "--name", type=base.unicode_decoder, default='', help='name of the invitee') 208 self.parser.add_argument("-n", "--name", type=base.unicode_decoder, default='', help='name of the invitee')
209 self.parser.add_argument("-N", "--host-name", type=base.unicode_decoder, default='', help='name of the host') 209 self.parser.add_argument("-N", "--host-name", type=base.unicode_decoder, default='', help='name of the host')
210 self.parser.add_argument("-l", "--lang", type=base.unicode_decoder, default='', help='main language spoken by the invitee') 210 self.parser.add_argument("-l", "--lang", type=base.unicode_decoder, default='', help='main language spoken by the invitee')
211 self.parser.add_argument("-u", "--url", type=base.unicode_decoder, default='', help='template to construct the URL') 211 self.parser.add_argument("-u", "--url", type=base.unicode_decoder, default='', help='template to construct the URL')
212 self.parser.add_argument("-S", "--subject", type=base.unicode_decoder, default='', help='subject of the invitation email (default: generic subject)') 212 self.parser.add_argument("-S", "--subject", type=base.unicode_decoder, default='', help='subject of the invitation email (default: generic subject)')
213 self.parser.add_argument("-b", "--body", type=base.unicode_decoder, default='', help='body of the invitation email (default: generic body)') 213 self.parser.add_argument("-b", "--body", type=base.unicode_decoder, default='', help='body of the invitation email (default: generic body)')
214 214
215 def start(self): 215 def start(self):
216 common.checkURI(self.args) 216 common.checkURI(self.args)
217 email = self.args.email[0] if self.args.email else None
218 emails_extra = self.args.email[1:]
217 219
218 self.host.bridge.eventInvite( 220 self.host.bridge.eventInvite(
219 self.args.service, 221 self.args.service,
220 self.args.node, 222 self.args.node,
221 self.args.item, 223 self.args.item,
222 self.args.email, 224 email,
225 emails_extra,
223 self.args.name, 226 self.args.name,
224 self.args.host_name, 227 self.args.host_name,
225 self.args.lang, 228 self.args.lang,
226 self.args.url, 229 self.args.url,
227 self.args.subject, 230 self.args.subject,