Jump to content

Recommended Posts

Posted (edited)

So the wife has been asked to sort out vouchers (Tesco in this case) for all the free school meal students in the schools within her MAT, Tesco do have a solution that essentually allows you to mail the vouchers to a mail address. There are a number of issues with this first one being the data held for mail address in their systems is well interesting at best and a large portion have no mail address at all. Tesco do offer a service to post out the cards as well but this can take between 3 and 5 days (and for lots of reasons right now will not even guarantee that).

 

From the CSV file they provide you can go to a link for each voucher and print it yourself, now anyone care to guess how this would take for ~1000 vouchers? as you can imagine its no small amount of time (she got it down to ~3 mins a voucher) so to save her having to spend the next couple of days and the RSI I wrote the following PowerShell Script:-

 

$Files = gci 'C:\Users\MP\Desktop\Tesco\EV_CSV\' | select FullName
$TEVData = Import-Csv $Files.FullName
$TEVBaseUrl = 'https://www.giftcards.tescoforbusiness.com/gift-card/view/'
$TEVData | % { 
$TokenUrl = $TEVBaseUrl + $_.Token
$TokenCC = $_.'Challenge Code'
$PNGSaveFldr = "C:\Users\MP\Desktop\Tesco\Images\$($_.OrderNumber)\"
$PNGFileName = $_.Token +'.PNG'

$driver = Start-SeFirefox

Enter-SeUrl -Driver $driver -url $TokenUrl

$element = Find-SeElement -Driver $driver -id 'id_value'

Send-SeKeys -Element $Element -Keys $TokenCC

Send-SeKeys -Element $Element -Keys ([OpenQA.Selenium.Keys]::enter)

Start-Sleep -Seconds 2

$screenShot = Invoke-SeScreenshot -Driver $driver

Save-SeScreenshot -Screenshot $screenShot -Path $PNGSaveFldr$PNGFileName -ImageFormat Png

Stop-SeDriver -Driver $driver

Clear-Variable driver

} 

 

So I am using the Selenium module (Install-Module Selenium) to do the work here (I would have liked to use an API and did take a look for a RESTful API but at first glance could not see that this was an option for the Tesco voucher site) and you will need FireFox installed on your computer (although Selenium has got the option to fire up other browsers (use get-command -module selenium for the full list of supported browsers))

 

First thing to do is get the csv(s) from the Tesco dashboard and change the $Files directory to that location, then the only other thing is to change where the image is saved ($PNGSaveFldr) is the var for that (what i have done is added the order number to Tesco's csv) so that if like in my case you have a load of different orders the image file is saved in a folder that matches that order number.

 

After running the script you end up with a png file for each of the urls that Tesco send you, from there you can print the vouchers out.

 

I am sure that this can be mangled to be used for any voucher sites, if needs be ask and i will help.

 

Hope this helps someone out.

 

H.

Edited by HPlum78
  • Thanks 1
Posted
Wonde have an online system for this, in case anyone isn’t aware. It’s free.

 

Have Wonde got back to you? We registered on Friday and have heard nothing - I called early yesterday morning and a lady said there'd be emails and information sent out by yesterday afternoon but we've had nothing.

Posted

We activates the FDM Vouchers bit in Wonde for one school on Friday which then had an advisory it would take 24-48 hours to go live. System went live over the weekend and second school activated yesterday was instant.

 

It's quite simple and quick to use. After activation it tells you how many people are FSM and the you can buy as many vouchers as you want, for how many days and then place the order. You can pay the voucher cost by PayPal, card or BACS. After payment has been received by Wonde you can say which students the vouchers are for and see which parenty person they will be sent to, and change that too.

 

After you have assigned the vouchers and Parents have selected the supermarket of choice Wonde then buy the vouchers and send them out in the evening.

Posted
Yeah they they had looked at that very solution but it would not have helped them in this instance anyhow. Everything became a little pressing....
Posted
It says on Wonde Twitter that they're working on making it more custom in terms of voucher amounts but in the first instance they were working against the clock to just get something out there.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...