A man who attempted to import almost 30,000 skull-shaped ecstasy tablets into the UK in a deal arranged over Snapchat has been jailed for four years.